/* ==========================================================================
   全局复古像素点阵字体、零抗锯齿与《星露谷物语》双层硬边像素投影统一规范
   ========================================================================== */

@font-face {
  font-family: 'Press Start 2P';
  src: url('fonts/press-start-2p.ttf') format('truetype');
  unicode-range: U+0020-007F;
  size-adjust: 86%;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Zpix';
  src: url('fonts/zpix.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fusion Pixel';
  src: url('fusion-pixel.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FusionPixel';
  src: url('fusion-pixel.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cubic 11';
  src: url('fonts/cubic-11.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --px-font-stack: 'Cubic 11', 'Zpix', 'Fusion Pixel', 'Press Start 2P', monospace;
}

/* 1. 全局强制开启像素点阵字体与锐化渲染，彻底关闭字体抗锯齿模糊 */
*,
*::before,
*::after {
  font-family: var(--px-font-stack) !important;
  -webkit-font-smoothing: none !important;
  -moz-osx-font-smoothing: grayscale !important;
  font-smooth: never !important;
  text-rendering: optimizeSpeed;
  image-rendering: pixelated;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--px-font-stack) !important;
}

/* 2. 全站清除任何现代圆角（仅保留游戏内特定图形外，全部 UI 0 圆角硬边） */
.app *,
.chapter-overlay *,
.hud-actions *,
.dialogue *,
.ch3-stage *,
.ch4-stage *,
.bag-card *,
.world-map-card * {
  border-radius: 0 !important;
}

/* 3. 深胡桃木棕 + 浅米色 1px 1px 0px 硬边内浮雕像素阴影（羊皮纸/木牌 UI） */
.wealth-bar,
.wealth-bar strong,
.wealth-bar small,
.frag-bar,
.frag-bar strong,
.hud-replay,
.dialogue,
.dialogue #speaker,
.dialogue #dialogue-text,
.dialogue .choices button,
.chapter-overlay .chapter-card,
.chapter-overlay .chapter-card h2,
.chapter-overlay .chapter-card h3,
.chapter-overlay .chapter-card p,
.chapter-overlay .chapter-card small,
.chapter-overlay .chapter-card strong,
.chapter-overlay .bag-split-card,
.chapter-overlay .bag-split-card h2,
.chapter-overlay .bag-detail-title,
.chapter-overlay .bag-detail-desc,
.chapter-overlay .rps-card,
.chapter-overlay .rps-card h2,
.chapter-overlay .pl-album-card,
.chapter-overlay .pl-album-card h2,
.treasure-scroll,
.treasure-scroll strong,
.treasure-scroll small,
.reward-banner,
.reward-banner strong,
.reward-banner small,
.cafe-quest,
.bottom-hint,
.tasting-dock,
.ch4-wood-btn,
.ch4-hud-pill,
.wm-plaque,
.wm-stat-chip,
.settings-menu button {
  color: #562C16;
  text-shadow: 1px 1px 0px #E8C794 !important;
}

.dialogue #speaker,
.chapter-overlay .chapter-card h2,
.chapter-overlay .bag-split-card h2,
.chapter-overlay .rps-card h2,
.chapter-overlay .pl-album-card h2,
.wm-title {
  color: #4A2311 !important;
  text-shadow: 1px 1px 0px #E8C794 !important;
}

/* 4. 深色底牌/按钮文字：奶油白或暖金黄 + 2px 2px 0px #2A160B 纯硬边深棕像素投影 */
.dialogue .next,
.primary-action,
.ch4-holo-head,
.ch4-holo-title,
.wm-header-scroll h2,
.wm-walker-tip {
  text-shadow: 2px 2px 0px #2A160B !important;
}

.wm-toast {
  width: max-content;
  max-width: calc(100% - 24px);
  white-space: normal;
  line-height: 1.45;
  font-weight: 400;
  text-shadow: none;
}

.primary-action,
.dialogue .next {
  color: #FFF8E7 !important;
  border-radius: 0 !important;
}

/* 5. 头顶气泡 & 交互提示统一改为阶梯状像素边缘气泡框（无圆角 + 像素点阵字 + 硬边阴影） */
.ch3-pixel-bubble,
.ch4-pixel-bubble,
.cafe-cust3 em,
.wm-walker-tip {
  border-radius: 0 !important;
  background: #F7E8CA !important;
  border: 2px solid #4A2311 !important;
  outline: 2px solid #E8C794;
  outline-offset: -4px;
  box-shadow:
    -2px 0 0 0 #4A2311,
    2px 0 0 0 #4A2311,
    0 -2px 0 0 #4A2311,
    0 2px 0 0 #4A2311,
    4px 4px 0 0 rgba(42, 22, 11, 0.45) !important;
  color: #562C16 !important;
  text-shadow: 1px 1px 0px #E8C794 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  padding: 6px 10px !important;
}

.wm-walker-tip {
  background: #3B5F39 !important;
  color: #FFF8E7 !important;
  outline-color: #C88C4B;
  text-shadow: 2px 2px 0px #2A160B !important;
}

.ch3-pixel-bubble::after,
.ch4-pixel-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 8px;
  height: 6px;
  transform: translateX(-50%);
  background: #4A2311;
  box-shadow: 0 -2px 0 0 #F7E8CA;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 68% 45%, 68% 100%, 32% 100%, 32% 45%, 0 45%);
}

/* 6. 消除任何残余模糊光晕，改用纯硬边投影 */
.hud-icon,
.hud-replay,
.wealth-bar,
.frag-bar,
.ch4-wood-btn,
.ch3-wood-btn,
.wm-node-btn,
.cafe-quest,
.bottom-hint {
  border-radius: 0 !important;
  filter: none !important;
}

/* 小屏幕下保持 HUD 和常用操作文字清晰可读。 */
.wealth-bar, .frag-bar, .hud-replay, .settings-menu button { font-size: max(12px, 0.9em); }
.dialogue #dialogue-text, .chapter-overlay p { line-height: 1.65; overflow-wrap: anywhere; }
.hud-actions button, .choices button, .ch4-wood-btn { line-height: 1.4; }
@media (max-width: 760px) {
  .dialogue #dialogue-text { font-size: 14px; }
}

/* 浅色对话按钮用单层深色字，避免深色重影和背景混在一起。 */
.dialogue .next, .dialogue-exit {
  color: #4A2311 !important;
  text-shadow: none !important;
  font-family: 'Cubic 11', 'Zpix', 'Fusion Pixel', monospace !important;
  font-weight: 400 !important;
  font-synthesis: none;
  letter-spacing: .04em;
  line-height: 1.4 !important;
  white-space: nowrap;
}
