/* ✦ M75 LIVE2D MASCOT STYLES — Averil0814 ✦
   模組化：獨立 CSS，僅微調 oh-my-live2d 內建元素，
   讓看板娘的對話框與狀態列融入 M75 HUD 賽博風格。
   ================================================================== */

/* 確保看板娘在內容之上、但低於 lightbox / 回到頂部按鈕 */
#oml2d-stage,
.oml2d-stage {
  z-index: 9000 !important;
}

/* ─── 對話泡泡：青色 HUD 玻璃風 ─── */
.oml2d-tips {
  background: rgba(8, 16, 24, 0.92) !important;
  border: 1px solid rgba(0, 210, 255, 0.55) !important;
  border-radius: 14px !important;
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.35),
              inset 0 0 12px rgba(0, 210, 255, 0.08) !important;
  color: #e8f6ff !important;
  font-family: 'Rajdhani', 'Noto Sans TC', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.3px !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.oml2d-tips::after,
.oml2d-tips::before {
  border-top-color: rgba(0, 210, 255, 0.55) !important;
}

/* ─── 狀態列（休息／喚回）按鈕 ─── */
.oml2d-status-bar {
  background: rgba(8, 16, 24, 0.92) !important;
  border: 1px solid rgba(0, 210, 255, 0.45) !important;
  color: #00d2ff !important;
  font-family: 'Rajdhani', 'Noto Sans TC', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.3) !important;
}

/* ─── 功能選單（切換模型／關於）按鈕 ─── */
.oml2d-menus {
  filter: drop-shadow(0 0 6px rgba(0, 210, 255, 0.4));
}
.oml2d-menus-item {
  color: #00d2ff !important;
}

/* ─── 行動裝置：縮小尺寸、避免遮擋內容 ─── */
@media (max-width: 768px) {
  #oml2d-stage,
  .oml2d-stage {
    transform-origin: bottom right;
    opacity: 0.96;
  }
  .oml2d-tips {
    font-size: 12px !important;
    max-width: 60vw !important;
  }
}

/* ─── 尊重使用者「減少動態」偏好：降低存在感 ─── */
@media (prefers-reduced-motion: reduce) {
  #oml2d-stage,
  .oml2d-stage {
    opacity: 0.85;
  }
}

/* ══════════════════════════════════════════════════════════════
   PNG 備用模式 — 單張圖片「伪動態」看板娘
   呼吸縮放 + 上下漂浮 + 輕微搖擺 + 陰影同步，
   搭配 JS 滑鼠視差與點擊彈跳，營造活著的錯覺。
   ══════════════════════════════════════════════════════════════ */

#m75-mascot {
  position: fixed;
  right: 18px;
  bottom: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
}
#m75-mascot.m75-hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

/* ─── 人物本體：呼吸 + 漂浮 + 搖擺 ─── */
.m75-mascot-figure {
  position: relative;
  cursor: pointer;
  animation: m75-float 4.5s ease-in-out infinite;
  transform-origin: bottom center;
}
.m75-mascot-img {
  display: block;
  width: 170px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.25));
  animation: m75-breathe 3.2s ease-in-out infinite;
  transform-origin: bottom center;
  transition: transform 0.35s ease-out; /* 滑鼠視差用 */
  will-change: transform;
}
/* 點擊彈跳 */
.m75-mascot-figure.bounce {
  animation: m75-bounce 0.55s cubic-bezier(0.28, 0.84, 0.42, 1),
             m75-float 4.5s ease-in-out 0.55s infinite;
}
/* 地面陰影：跟著漂浮節奏縮放 */
.m75-mascot-shadow {
  width: 70%;
  height: 12px;
  margin: -4px auto 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 210, 255, 0.35) 0%, transparent 70%);
  animation: m75-shadow 4.5s ease-in-out infinite;
}

/* ─── 對話泡泡（沿用 HUD 玻璃風）─── */
.m75-mascot-bubble {
  max-width: 230px;
  margin-bottom: 10px;
  padding: 9px 14px;
  background: rgba(8, 16, 24, 0.92);
  border: 1px solid rgba(0, 210, 255, 0.55);
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.35),
              inset 0 0 12px rgba(0, 210, 255, 0.08);
  color: #e8f6ff;
  font-family: 'Rajdhani', 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  position: relative;
}
.m75-mascot-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(8, 16, 24, 0.92);
  border-right: 1px solid rgba(0, 210, 255, 0.55);
  border-bottom: 1px solid rgba(0, 210, 255, 0.55);
}
.m75-mascot-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ─── 隱藏按鈕 ─── */
.m75-mascot-toggle {
  position: absolute;
  top: 36px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 210, 255, 0.45);
  background: rgba(8, 16, 24, 0.9);
  color: rgba(0, 210, 255, 0.8);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s;
}
#m75-mascot:hover .m75-mascot-toggle { opacity: 1; }
.m75-mascot-toggle:hover { background: rgba(0, 210, 255, 0.2); }

/* ─── 喚回小籤 ─── */
#m75-mascot-chip {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 9000;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0, 210, 255, 0.5);
  background: rgba(8, 16, 24, 0.92);
  color: #00d2ff;
  font-family: 'Rajdhani', 'Noto Sans TC', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.3);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}
#m75-mascot-chip.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#m75-mascot-chip:hover { background: rgba(0, 210, 255, 0.15); }

/* ─── Keyframes ─── */
@keyframes m75-float {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50%      { transform: translateY(-10px) rotate(0.6deg); }
}
@keyframes m75-breathe {
  0%, 100% { scale: 1 1; }
  50%      { scale: 1.012 0.988; }
}
@keyframes m75-shadow {
  0%, 100% { transform: scaleX(1);    opacity: 0.9; }
  50%      { transform: scaleX(0.82); opacity: 0.55; }
}
@keyframes m75-bounce {
  0%   { transform: translateY(0)    scale(1, 1); }
  30%  { transform: translateY(2px)  scale(1.06, 0.92); }
  60%  { transform: translateY(-14px) scale(0.96, 1.05); }
  100% { transform: translateY(0)    scale(1, 1); }
}

/* ─── 行動裝置：縮小、避免遮擋 ─── */
@media (max-width: 768px) {
  .m75-mascot-img { width: 110px; }
  .m75-mascot-bubble { max-width: 55vw; font-size: 12px; }
}

/* ─── 減少動態偏好：停用所有伪動態 ─── */
@media (prefers-reduced-motion: reduce) {
  .m75-mascot-figure,
  .m75-mascot-img,
  .m75-mascot-shadow {
    animation: none !important;
  }
}
