/* 貓貓谷 版面精修 + 原廠素材點綴 · 2026-10-29
   ・只在載入這個檔案的頁面生效（第一批：index.php、signin.php）。
   ・不改變配色、字體與功能；所有規則都限定在既有的 body class 之下。
   ・原廠素材：sprites/ 內為 V282 Data 原生 PNG，以原尺寸或整數倍、像素清晰顯示。
   ・移除方式：刪除頁面上引用本檔的那一行 <link> 即完全還原。 */

/* ===================================================================
   共用：原廠像素圖示的顯示方式
   =================================================================== */
:root {
  --mp-sprite-shadow: drop-shadow(0 2px 2px rgba(0, 0, 0, .28));
}

/* ===================================================================
   首頁 index.php（body.meow-home-v2）
   =================================================================== */

/* 1. 此刻的貓貓谷：在線人數區塊右下角站一隻菇菇寶貝，標題旁放菇菇開心表情 */
body.meow-home-v2 .live-panel .online-block::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 63px;
  height: 58px;
  background: url("sprites/mob-mushroom.png") no-repeat center bottom / 63px 58px;
  image-rendering: pixelated;
  filter: var(--mp-sprite-shadow);
  z-index: 1;
  pointer-events: none;
}
body.meow-home-v2 .live-panel .online-block p {
  max-width: calc(100% - 66px);
}
body.meow-home-v2 .live-panel #live-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
body.meow-home-v2 .live-panel #live-title::after {
  content: "";
  flex: 0 0 auto;
  width: 32px;
  height: 30px;
  margin: -8px 0 -8px;
  background: url("sprites/emo-mushroom-happy.png") no-repeat center / 32px 30px;
}

/* 2. 區塊標題前的經典怪物（原尺寸，站在文字基線上） */
body.meow-home-v2 :is(.home-rewards-column, .home-contest-column) .section-label h2,
body.meow-home-v2 #mw-title {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
body.meow-home-v2 :is(.home-rewards-column, .home-contest-column) .section-label h2::before,
body.meow-home-v2 #mw-title::before {
  content: "";
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center bottom;
  image-rendering: pixelated;
  filter: var(--mp-sprite-shadow);
  margin-bottom: .12em;
}
body.meow-home-v2 .home-rewards-column .section-label h2::before {
  width: 37px; height: 26px;
  background-image: url("sprites/mob-snail.png");
  background-size: 37px 26px;
}
body.meow-home-v2 .home-contest-column .section-label h2::before {
  width: 64px; height: 49px;
  background-image: url("sprites/mob-slime.png");
  background-size: 64px 49px;
}
body.meow-home-v2 #mw-title::before {
  width: 68px; height: 40px;
  background-image: url("sprites/mob-pig.png");
  background-size: 68px 40px;
}

/* 3. 穿搭大賽載入中：用菇菇「疑惑」表情取代 ✦ */
body.meow-home-v2 .hcs-state-orbit > span {
  font-size: 0 !important;
  line-height: 0;
  display: block;
  width: 82px;
  height: 59px;
  background: url("sprites/emo-mushroom-huh.png") no-repeat center / 82px 59px;
  image-rendering: auto;
}

/* 4. 遊戲獎勵清單：道具改成遊戲背包格的樣子，圖示整數 2 倍、像素清晰 */
body.meow-home-v2 .mr-rewards .mr-item:not(.mr-item--resource):not(.mr-item--currency) {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: start;
  text-align: center;
  gap: 4px !important;
  padding: 12px 8px 10px !important;
}
body.meow-home-v2 .mr-rewards .mr-item:not(.mr-item--resource):not(.mr-item--currency) .mr-icon {
  grid-row: auto !important;
  width: 72px !important;
  height: 72px !important;
  border-radius: 12px;
  overflow: visible;
}
body.meow-home-v2 .mr-rewards .mr-item:not(.mr-item--resource):not(.mr-item--currency) .mr-icon img {
  max-width: none !important;
  max-height: none !important;
  transform: scale(2);
  image-rendering: pixelated;
}
body.meow-home-v2 .mr-rewards .mr-item:not(.mr-item--resource):not(.mr-item--currency) .mr-name {
  grid-column: auto !important;
}
body.meow-home-v2 .mr-rewards .mr-item:not(.mr-item--resource):not(.mr-item--currency) .mr-detail {
  display: block;
}
body.meow-home-v2 .mr-rewards .mr-item:not(.mr-item--resource):not(.mr-item--currency) .mr-quantity {
  grid-column: auto !important;
  margin-top: 0 !important;
  align-self: center !important;
}

/* ---------- 手機（≤740px，與現有斷點一致） ---------- */
@media (max-width: 740px) {
  /* 5. 在線數據移到相簿上方，並收成精簡版 */
  body.meow-home-v2 .hero-grid .live-panel { grid-row: 1; }
  body.meow-home-v2 .hero-grid .album-panel { grid-row: 2; }

  body.meow-home-v2 .live-panel .panel-heading { padding: 14px 15px 0; }
  body.meow-home-v2 .live-panel .online-block {
    margin: 10px 15px 0;
    padding: 12px 14px;
  }
  /* 手機版在線區塊較窄，菇菇寶貝只保留在標題旁的表情 */
  body.meow-home-v2 .live-panel .online-block::after { display: none; }
  body.meow-home-v2 .live-panel .online-block p { max-width: none; }
  body.meow-home-v2 .live-panel .stat-list {
    margin: 4px 15px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
  }
  body.meow-home-v2 .live-panel .stat-list .stat-row {
    min-height: 40px;
  }
  body.meow-home-v2 .live-panel .stat-list .stat-row.uptime {
    grid-column: 1 / -1;
  }
  body.meow-home-v2 .live-panel .stats-footer { padding-top: 8px; padding-bottom: 10px; }

  /* 6. AI 小幫手按鈕不壓住相簿的箭頭與縮圖 */
  body.meow-home-v2 #chatFloatContainer.chat-float-container,
  body.meow-home-v2 #chatFloatContainer.cw-preview {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* 獎勵格：手機兩欄，圖示仍為整數 2 倍 */
  body.meow-home-v2 .mr-rewards .mr-item:not(.mr-item--resource):not(.mr-item--currency) .mr-icon {
    width: 68px !important;
    height: 68px !important;
  }

}


/* ===================================================================
   登入頁 signin.php（body.page-inner.meow-modern-chrome）
   =================================================================== */

/* 7. 左側品牌欄底部：四隻經典怪物站在草地上 */
body.meow-modern-chrome .auth-brand-panel::after {
  content: "";
  display: block !important;
  position: absolute;
  inset: auto 0 0 0 !important;
  width: auto !important;
  height: 92px !important;
  opacity: 1 !important;
  transform: none !important;
  background:
    url("sprites/mob-snail.png") no-repeat left 22% bottom 18px / 37px 26px,
    url("sprites/mob-slime.png") no-repeat left 40% bottom 18px / 64px 49px,
    url("sprites/mob-mushroom.png") no-repeat left 64% bottom 18px / 63px 58px,
    url("sprites/mob-pig.png") no-repeat left 88% bottom 18px / 68px 40px,
    linear-gradient(to bottom, transparent 0 74px, #5aa63c 74px 78px, #3f7a2c 78px 100%);
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 0;
}
body.meow-modern-chrome .auth-brand-panel .auth-brand-content { z-index: 1; }

/* 8. 登入頁頁尾：與首頁一致的深藍（深色）／淺藍灰（淺色） */
body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer {
  background: #f3f7fb !important;
  border-top: 1px solid rgba(35, 64, 90, .08) !important;
  box-shadow: none !important;
  color: #5d6f82 !important;
}
body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer * {
  text-shadow: none !important;
}
body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer .footer-link {
  background: rgba(35, 64, 90, .05) !important;
  border: 1px solid rgba(35, 64, 90, .14) !important;
}
html[data-meow-theme="dark"] body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer .footer-link {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
}
html[data-meow-theme="dark"] body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer {
  background: #0b1421 !important;
  border-top: 1px solid #414956 !important;
  color: #8d9db2 !important;
}
html body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer :is(.footer-copy, .footer-disclaimer, .footer-legal-sep, p) {
  color: #5d6f82 !important;
}
html[data-meow-theme="dark"] body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer :is(.footer-copy, .footer-disclaimer, .footer-legal-sep, p) {
  color: #8d9db2 !important;
}
html body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer :is(.footer-legal-link, .footer-link) {
  color: #2a4a68 !important;
}
html[data-meow-theme="dark"] body.page-inner.meow-modern-chrome:has(.auth-section) footer.footer :is(.footer-legal-link, .footer-link) {
  color: #c9d6e6 !important;
}

/* 9. 登入頁背景：改用遊戲原廠登入畫面（backgrounds/login-back.webp，1366×768）
      取代原本全站共用的城堡圖；只影響有 .auth-section 的頁面（登入頁）。 */
body.page-inner.meow-modern-chrome:has(.auth-section) .site-scroll-bg {
  opacity: 1 !important;
  overflow: hidden;
  background: #f3f7fb url("backgrounds/login-back.webp") center 40% / cover no-repeat;
}
body.page-inner.meow-modern-chrome:has(.auth-section) .site-scroll-bg__img {
  display: none !important;
}
body.page-inner.meow-modern-chrome:has(.auth-section) .site-scroll-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 淺色：中間淡淡一層白，兩側保留原圖色彩 */
  background:
    radial-gradient(ellipse 60% 75% at 50% 50%, rgba(243, 247, 251, .55), rgba(243, 247, 251, .12) 70%, rgba(243, 247, 251, 0) 100%);
}
html[data-meow-theme="dark"] body.page-inner.meow-modern-chrome:has(.auth-section) .site-scroll-bg {
  background-color: #0b1421;
}
html[data-meow-theme="dark"] body.page-inner.meow-modern-chrome:has(.auth-section) .site-scroll-bg::after {
  /* 深色：整體壓暗成首頁的深藍，中間再暗一些讓表單更清楚 */
  background:
    radial-gradient(ellipse 60% 75% at 50% 50%, rgba(11, 20, 33, .78), rgba(11, 20, 33, .5) 75%),
    rgba(11, 20, 33, .25);
}
/* 手機版原本隱藏背景圖、只剩深藍底；登入頁改為也顯示原廠登入畫面 */
@media (max-width: 980px) {
  body.page-inner.meow-modern-chrome:has(.auth-section) .site-scroll-bg {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    z-index: 0;
  }
  body.page-inner.meow-modern-chrome:has(.auth-section) .main-content {
    position: relative;
    z-index: 1;
  }
}
