/* ============================================================================
   风雪官网 · 网页小游戏「雪原小狐狸」
   样式表（独立文件，不改动站点的 style.css / tune.css）

   设计口径：
     · 全部视觉语言取自 Minecraft：像素方块、硬边阴影、栅格对齐
     · 配色以 MC 雪原生物群系为主：冰蓝、雪白、云杉深绿、紫水晶紫
     · 界面单位以 4px 为栅格（MC 的 GUI 也是按 4 的倍数走的）
     · 不引外部字体，用系统字体栈；数字用等宽，避免跳动
   ========================================================================== */

/* ── 令牌 ───────────────────────────────────────────────────────────────── */
:root {
  /* 雪原色板（取自 MC 贴图实测色值） */
  --snow:      #f2f7fb;
  --snow-2:    #dce8f2;
  --snow-3:    #b9cee0;
  --ice:       #a8d8f0;
  --ice-deep:  #4a90b8;
  --ice-dark:  #2d5f7d;
  --water:     #3b6ea5;
  --spruce:    #2d4a3e;
  --spruce-2:  #1d332a;
  --stone:     #6b7280;
  --stone-2:   #4b5563;
  --amethyst:  #9b6dd6;
  --amethyst-2:#7c4dbb;
  --gold:      #f0c060;
  --gold-2:    #c99430;
  --fox:       #e8eef5;
  --fox-ear:   #c8d4e0;
  --danger:    #c0504d;
  --ok:        #4a9d5f;

  /* 文字 */
  --ink:       #1a2430;
  --ink-2:     #46586b;
  --ink-3:     #7a8fa3;
  --ink-inv:   #eef4fa;

  /* 面板 */
  --panel:     #1e2a38;
  --panel-2:   #27364a;
  --panel-3:   #31445c;
  --panel-line:#3d5169;

  /* MC 式硬阴影（不用模糊，用偏移的纯色块） */
  --sh-1: 0 2px 0 0 rgba(0,0,0,.35);
  --sh-2: 0 4px 0 0 rgba(0,0,0,.4);
  --sh-in: inset 0 2px 0 0 rgba(255,255,255,.08), inset 0 -3px 0 0 rgba(0,0,0,.3);

  --r: 4px;          /* 圆角极小，MC 的 GUI 是硬边 */
  --u: 4px;          /* 栅格单位 */
}

/* ── 基础 ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

.game-root {
  /* 深色雪原底色，配像素噪点 */
  background-color: #0d1620;
  background-image:
    radial-gradient(1200px 600px at 50% -10%, #1a3048 0%, transparent 70%),
    radial-gradient(800px 400px at 80% 100%, #1b2b3d 0%, transparent 60%);
  color: var(--ink-inv);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100%;
  padding: 0;
  /* 像素化渲染：让贴图放大时保持硬边 */
}

.game-root img,
.game-root canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── 外壳 ───────────────────────────────────────────────────────────────── */
.game-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.game-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--panel-line);
}

.game-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-title .ico { width: 32px; height: 32px; }

.game-sub {
  margin: 0;
  color: var(--ink-3);
  font-size: 12.5px;
}

.game-head-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── 按钮：MC 风格硬边按钮 ─────────────────────────────────────────────── */
.mc-btn {
  --bg: var(--panel-2);
  --bg-h: var(--panel-3);
  appearance: none;
  border: 0;
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink-inv);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: var(--sh-1), inset 0 1px 0 0 rgba(255,255,255,.12), inset 0 -2px 0 0 rgba(0,0,0,.3);
  transition: transform .06s, background .12s, box-shadow .12s;
  position: relative;
  white-space: nowrap;
  user-select: none;
}
.mc-btn:hover:not(:disabled) { background: var(--bg-h); }
.mc-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 0 0 rgba(0,0,0,.35), inset 0 1px 0 0 rgba(255,255,255,.1), inset 0 -1px 0 0 rgba(0,0,0,.3);
}
.mc-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
  filter: grayscale(.5);
}
.mc-btn:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.mc-btn--primary { --bg: var(--ice-deep); --bg-h: #5aa5ce; }
.mc-btn--gold    { --bg: var(--gold-2); --bg-h: var(--gold); color: #2a1e00; }
.mc-btn--danger  { --bg: #a8433f; --bg-h: var(--danger); }
.mc-btn--ghost   { --bg: transparent; box-shadow: inset 0 0 0 2px var(--panel-line); }
.mc-btn--ghost:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.mc-btn--sm { font-size: 12px; padding: 5px 10px; }

/* 冷却中的按钮：显示剩余秒数的进度条 */
.mc-btn[data-cool] {
  position: relative;
  overflow: hidden;
}
.mc-btn[data-cool]::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: var(--cool-pct, 0%);
  background: var(--ice);
  transition: width .3s linear;
}

/* ── 场景：主舞台 ───────────────────────────────────────────────────────── */
.scene {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #16222f;
  box-shadow: var(--sh-2);
  margin-bottom: 16px;
  /* 高度随视口，但给上下限 */
  min-height: 320px;
}

.scene-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    #14263a 0%,
    #1e3a52 35%,
    #2d5470 62%,
    #4a7d9c 82%,
    #8fb8d0 100%);
}

/* 星星：纯 CSS，无外部资源 */
.scene-stars {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 32% 8%,  #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 58% 22%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 74% 12%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 88% 26%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 22% 32%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 46% 6%,  #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 66% 30%, #fff 50%, transparent 50%);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: .65; } }

/* 远山剪影 */
.scene-mtn {
  position: absolute;
  left: 0; right: 0; bottom: 28%;
  height: 34%;
  background:
    linear-gradient(135deg, transparent 45%, #1a2f42 45%) 0 0 / 120px 100% repeat-x,
    linear-gradient(45deg,  transparent 45%, #16283a 45%) 60px 0 / 140px 100% repeat-x;
  opacity: .85;
}

/* 雪地地面 */
.scene-ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30%;
  background-color: #dbe7f2;
  background-image: url("assets/tex/snow.png");
  background-size: 48px 48px;
  box-shadow: inset 0 6px 0 0 #b9cee0, inset 0 0 60px 0 rgba(120,160,200,.35);
  image-rendering: pixelated;
}
.scene-ground::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -6px;
  height: 8px;
  background-image: url("assets/tex/snow2.png");
  background-size: 32px 32px;
  opacity: .8;
}

/* 雪粒子：CSS 动画，每秒几片 */
.scene-snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snowflake {
  position: absolute;
  top: -12px;
  width: 4px; height: 4px;
  background: #fff;
  opacity: .75;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translateY(var(--fall-dist, 520px)) translateX(var(--drift, 20px)); }
}

/* ── 狐狸（主角）────────────────────────────────────────────────────────── */
.fox-stage {
  position: absolute;
  left: 50%;
  bottom: 26%;
  transform: translateX(-50%);
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  transition: transform .3s;
}

.fox {
  width: 100%;
  height: 100%;
  position: relative;
  animation: breathe 2.6s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes breathe {
  0%, 100% { transform: scaleY(1) scaleX(1); }
  50%      { transform: scaleY(.97) scaleX(1.015); }
}

/* 狐狸用贴图切片拼（MC 实体贴图按 UV 切开），
   这里简化：直接显示整张贴图的关键部位 —— 用 CSS 背景定位取头部 */
.fox-body {
  position: absolute;
  inset: 0;
  background-image: url("assets/tex/fox_snow.png");
  background-repeat: no-repeat;
  /* fox_snow.png 是 48x32 的 UV 图；头部在左上 16x16 区域，身体在 (16,16) 起 24x16 */
  background-size: 144px 96px;   /* 放大 3 倍 */
  background-position: -48px -48px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 0 rgba(40,60,80,.35));
}

/* 简化方案：用一个「狐狸头」方块 + 两只耳朵，纯 CSS 拼，
   贴图只用来取毛色纹理。这样在任意缩放下都清晰。 */
.fox-sprite {
  position: relative;
  width: 120px;
  height: 110px;
  filter: drop-shadow(0 6px 0 rgba(30,45,60,.3));
}
.fox-sprite .fx-head {
  position: absolute;
  left: 50%; top: 22px;
  transform: translateX(-50%);
  width: 92px; height: 78px;
  background-color: #e9eef4;
  background-image: url("assets/tex/fox_snow.png");
  background-size: 276px 184px;
  background-position: -46px -138px;   /* 取头部 UV 区 */
  border-radius: 10px 10px 14px 14px;
  box-shadow: inset 0 -6px 0 rgba(190,205,220,.6), inset 0 4px 0 rgba(255,255,255,.5);
  image-rendering: pixelated;
}
/* 耳朵 */
.fox-sprite .fx-ear {
  position: absolute;
  top: 4px;
  width: 26px; height: 30px;
  background: #e9eef4;
  border-radius: 6px 6px 2px 2px;
  box-shadow: inset 0 -4px 0 #c8d4e0;
  transform-origin: bottom center;
}
.fox-sprite .fx-ear.l { left: 12px;  transform: rotate(-10deg); }
.fox-sprite .fx-ear.r { right: 12px; transform: rotate(10deg); }
/* 耳朵内侧 */
.fox-sprite .fx-ear::after {
  content: "";
  position: absolute;
  inset: 6px 6px 8px;
  background: #b9c8d8;
  border-radius: 3px 3px 1px 1px;
}
/* 眼睛：两块 6px 方块（MC 式方眼） */
.fox-sprite .fx-eye {
  position: absolute;
  top: 52px;
  width: 10px; height: 12px;
  background: #17212c;
  border-radius: 2px;
  transition: height .1s;
}
.fox-sprite .fx-eye.l { left: 32px; }
.fox-sprite .fx-eye.r { right: 32px; }
.fox-sprite.blink .fx-eye { height: 3px; }
/* 鼻头 */
.fox-sprite .fx-nose {
  position: absolute;
  left: 50%; top: 76px;
  transform: translateX(-50%);
  width: 12px; height: 10px;
  background: #3a4a5c;
  border-radius: 3px;
}
/* 腮红（互动时出现） */
.fox-sprite .fx-blush {
  position: absolute;
  top: 66px;
  width: 14px; height: 8px;
  background: #f0a0a8;
  border-radius: 7px;
  opacity: 0;
  transition: opacity .3s;
}
.fox-sprite .fx-blush.l { left: 18px; }
.fox-sprite .fx-blush.r { right: 18px; }
.fox-stage.happy .fx-blush { opacity: .85; }

/* 睡觉状态 */
.fox-stage.sleeping .fox-sprite { transform: rotate(-4deg); }
.fox-stage.sleeping .fx-eye { height: 3px; }

/* 狐狸的对话气泡 */
.fox-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(26% + 172px);
  transform: translateX(-50%) translateY(6px);
  background: #fff;
  color: #1a2430;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  max-width: 320px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  box-shadow: 0 4px 0 rgba(20,35,50,.25);
  z-index: 5;
}
.fox-bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -8px;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}
.fox-bubble.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 飘字（+20 金币）────────────────────────────────────────────────────── */
.float-num {
  position: absolute;
  font-weight: 800;
  font-size: 16px;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 8px rgba(240,192,96,.6);
  pointer-events: none;
  animation: floatUp 1.1s ease-out forwards;
  font-variant-numeric: tabular-nums;
  z-index: 6;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(0) scale(.8); }
  18%  { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-70px) scale(1); }
}

/* ── 状态条 ─────────────────────────────────────────────────────────────── */
.hud {
  position: absolute;
  left: 16px; top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14,24,34,.72);
  border-radius: var(--r);
  padding: 4px 10px 4px 6px;
  font-size: 12px;
  backdrop-filter: blur(2px);
}
.hud-row .ico { width: 18px; height: 18px; flex: 0 0 18px; }
.hud-row .lbl { color: var(--ink-3); min-width: 30px; }
.hud-bar {
  width: 96px; height: 8px;
  background: rgba(0,0,0,.45);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.6);
}
.hud-bar > i {
  display: block;
  height: 100%;
  width: 0;
  transition: width .35s ease-out;
}
.hud-bar.aff  > i { background: linear-gradient(90deg, #e06b8b, #f0a0a8); }
.hud-bar.sat  > i { background: linear-gradient(90deg, #c99430, var(--gold)); }
.hud-bar.spi  > i { background: linear-gradient(90deg, var(--amethyst-2), var(--amethyst)); }
.hud-num { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 28px; text-align: right; }

/* 右上角金币 */
.hud-coin {
  position: absolute;
  right: 16px; top: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(14,24,34,.78);
  border-radius: var(--r);
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  z-index: 4;
  box-shadow: inset 0 0 0 1px rgba(240,192,96,.28);
}
.hud-coin img { width: 18px; height: 18px; }
.hud-coin b { font-variant-numeric: tabular-nums; }

/* 阶段标签 */
.hud-stage {
  position: absolute;
  left: 16px; bottom: 16px;
  background: rgba(14,24,34,.78);
  border-radius: var(--r);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ice);
  z-index: 4;
  box-shadow: inset 0 0 0 1px rgba(168,216,240,.25);
}

/* ── 互动按钮区 ─────────────────────────────────────────────────────────── */
.actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  background: var(--panel);
  border-radius: 6px;
  border: 0;
  color: var(--ink-inv);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--sh-1), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .06s, background .12s;
  position: relative;
  overflow: hidden;
}
.act:hover:not(:disabled) { background: var(--panel-2); }
.act:active:not(:disabled) { transform: translateY(2px); }
.act:disabled { cursor: not-allowed; }
.act:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }

.act .act-ico {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06);
  border-radius: var(--r);
  transition: transform .15s;
}
.act:hover:not(:disabled) .act-ico { transform: scale(1.08); }
.act .act-ico img { width: 26px; height: 26px; }
.act .act-name { font-size: 13px; font-weight: 600; }
.act .act-cost { font-size: 11px; color: var(--ink-3); }

/* 冷却遮罩 */
.act .act-cool {
  position: absolute;
  inset: 0;
  background: rgba(8,14,22,.72);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--ice);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.act.cooling .act-cool { opacity: 1; }
.act.cooling .act-cool::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: var(--cool-pct, 0%);
  background: var(--ice);
}

/* 锁定态（未解锁） */
.act.locked { opacity: .55; }
.act.locked .act-ico { filter: grayscale(1) brightness(.7); }

/* ── 面板 ───────────────────────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border-radius: 6px;
  padding: 16px;
  box-shadow: var(--sh-1), inset 0 1px 0 rgba(255,255,255,.06);
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-line);
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.panel-head .hint { margin-left: auto; font-size: 12px; color: var(--ink-3); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── 成长条 ─────────────────────────────────────────────────────────────── */
.growth {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.growth-label { font-size: 12px; color: var(--ink-3); min-width: 56px; }
.growth-bar {
  flex: 1;
  height: 12px;
  background: rgba(0,0,0,.4);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4);
  position: relative;
}
.growth-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ice-deep), var(--ice));
  transition: width .5s cubic-bezier(.3,.9,.4,1);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
}
.growth-val { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 74px; text-align: right; }

/* ── 图鉴 ───────────────────────────────────────────────────────────────── */
.dex {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.dex-item {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.04);
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  position: relative;
  cursor: default;
}
.dex-item img { width: 32px; height: 32px; }
.dex-item.unknown img { filter: grayscale(1) brightness(0) opacity(.28); }
.dex-item.got {
  box-shadow: inset 0 0 0 2px rgba(240,192,96,.45);
  background: rgba(240,192,96,.08);
}
.dex-item .dex-n {
  position: absolute;
  right: 4px; bottom: 2px;
  font-size: 9px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ── 故事列表 ───────────────────────────────────────────────────────────── */
.story-box {
  min-height: 80px;
  background: rgba(0,0,0,.22);
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--snow-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.story-box .story-empty { color: var(--ink-3); }

/* ── 排行 ───────────────────────────────────────────────────────────────── */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 13px;
}
.rank-list li:last-child { border-bottom: 0; }
.rank-no {
  width: 22px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.rank-list li:nth-child(1) .rank-no { color: var(--gold); }
.rank-list li:nth-child(2) .rank-no { color: #c0c8d0; }
.rank-list li:nth-child(3) .rank-no { color: #c99430; }
.rank-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { color: var(--ice); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── 提示条 ─────────────────────────────────────────────────────────────── */
.toast-layer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  pointer-events: none;
}
.toast {
  background: var(--panel-2);
  color: var(--ink-inv);
  border-radius: var(--r);
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: var(--sh-2), inset 0 0 0 1px rgba(255,255,255,.08);
  animation: toastIn .28s ease-out;
  max-width: 320px;
}
.toast.ok   { box-shadow: var(--sh-2), inset 0 0 0 1px rgba(74,157,95,.5); }
.toast.warn { box-shadow: var(--sh-2), inset 0 0 0 1px rgba(240,192,96,.5); }
.toast.err  { box-shadow: var(--sh-2), inset 0 0 0 1px rgba(192,80,77,.5); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── 起始页 / 起名 ───────────────────────────────────────────────────────── */
.welcome {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  /* 半透明即可：底下的雪景要能透出来，全黑会让未登录的首屏像坏掉了 */
  background: rgba(8,14,22,.55);
  backdrop-filter: blur(2px);
  z-index: 10;
  padding: 24px;
}

/* 未登录时：整块场景压暗但不遮死，让玩家先看到「这里有一只狐狸在等你」 */
.scene.is-locked .scene-sky { filter: saturate(.6) brightness(.75); }
.scene.is-locked .scene-ground { filter: brightness(.8); }
.scene.is-locked .fox-stage {
  /* 未入园也能看见一只剪影，比空白好 —— 但必须明显是「还没属于你」的状态 */
  opacity: .45;
  filter: grayscale(.55);
  display: grid !important;
}
.welcome-card {
  background: var(--panel);
  border-radius: 8px;
  padding: 28px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--sh-2), inset 0 0 0 1px rgba(255,255,255,.08);
}
.welcome-card h2 { margin: 0 0 10px; font-size: 19px; }
.welcome-card p { margin: 0 0 18px; color: var(--ink-3); font-size: 13.5px; line-height: 1.8; }
.mc-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,.35);
  border: 0;
  border-radius: var(--r);
  color: var(--ink-inv);
  font: inherit;
  font-size: 14px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.08);
  margin-bottom: 14px;
  text-align: center;
}
.mc-input:focus {
  outline: 0;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4), inset 0 0 0 2px var(--ice);
}

/* ── 下注面板 ───────────────────────────────────────────────────────────── */
.bet {
  background: linear-gradient(160deg, #1b2b3d, #223a4e);
  border-radius: 6px;
  padding: 18px;
  box-shadow: var(--sh-1), inset 0 0 0 1px rgba(155,109,214,.22);
}
.bet-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--amethyst);
}
.bet-desc { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.8; }
.bet-stakes { display: flex; gap: 10px; margin-bottom: 14px; }
.bet-stake {
  flex: 1;
  padding: 12px 8px;
  background: rgba(0,0,0,.3);
  border: 0;
  border-radius: var(--r);
  color: var(--ink-inv);
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow .12s, background .12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.bet-stake:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.bet-stake.on {
  box-shadow: inset 0 0 0 2px var(--amethyst);
  background: rgba(155,109,214,.14);
}
.bet-stake:disabled { opacity: .4; cursor: not-allowed; }
.bet-stake b { font-size: 16px; font-variant-numeric: tabular-nums; }
.bet-stake small { font-size: 10.5px; color: var(--ink-3); }
.bet-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.bet-meta b { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* 下注结果动画 */
.bet-result {
  text-align: center;
  padding: 20px;
  font-size: 17px;
  font-weight: 700;
  border-radius: var(--r);
  animation: popIn .3s cubic-bezier(.2,1.4,.4,1);
}
.bet-result.win  { background: rgba(74,157,95,.16); color: #7ddb95; box-shadow: inset 0 0 0 2px rgba(74,157,95,.4); }
.bet-result.lose { background: rgba(192,80,77,.14); color: #e89090; box-shadow: inset 0 0 0 2px rgba(192,80,77,.35); }
@keyframes popIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── 响应式：三档 ───────────────────────────────────────────────────────── */
/* 大屏（≥1400）：场景更高，狐狸更大 */
@media (min-width: 1400px) {
  .scene { min-height: 420px; }
  .fox-stage { width: 190px; height: 190px; }
  .fox-sprite { width: 150px; height: 138px; }
}

/* 中屏（1100–1399） */
@media (max-width: 1399px) and (min-width: 1100px) {
  .game-wrap { max-width: 1000px; }
}

/* 窄屏（<1100）：按钮从 5 列改 3 列 */
@media (max-width: 1099px) {
  .game-wrap { padding: 12px 12px 40px; }
  .actions { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .scene { min-height: 340px; }
}

/* 手机（<700）：2 列按钮，场景变矮，HUD 缩小 */
@media (max-width: 699px) {
  .actions { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .act { padding: 10px 6px 8px; }
  .act .act-ico { width: 30px; height: 30px; }
  .act .act-ico img { width: 22px; height: 22px; }
  .act .act-name { font-size: 12px; }
  .scene { min-height: 300px; }
  .fox-stage { width: 120px; height: 120px; }
  .fox-sprite { width: 96px; height: 88px; }
  .fox-sprite .fx-head { width: 74px; height: 62px; background-size: 222px 148px; background-position: -37px -111px; }
  .fox-sprite .fx-eye { top: 42px; width: 8px; height: 10px; }
  .fox-sprite .fx-eye.l { left: 26px; }
  .fox-sprite .fx-eye.r { right: 26px; }
  .fox-sprite .fx-nose { top: 61px; width: 10px; height: 8px; }
  .fox-sprite .fx-ear { width: 21px; height: 24px; }
  .fox-sprite .fx-blush { top: 53px; width: 11px; height: 6px; }
  .hud { left: 10px; top: 10px; gap: 4px; }
  .hud-row { padding: 3px 8px 3px 5px; font-size: 11px; }
  .hud-bar { width: 62px; height: 6px; }
  .hud-coin { right: 10px; top: 10px; padding: 5px 9px; font-size: 13px; }
  .hud-stage { left: 10px; bottom: 10px; font-size: 11px; padding: 4px 9px; }
  .fox-bubble { bottom: calc(26% + 130px); font-size: 12px; max-width: 240px; }
  .game-title { font-size: 17px; }
  .panel { padding: 12px; }
}

/* 极窄（<400）：单列 */
@media (max-width: 399px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .scene { min-height: 270px; }
}

/* 降低动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .fox, .scene-stars, .snowflake { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

/* 深色/浅色主题：游戏页一律深色（MC 风格），不跟随站点主题切换 */
@media print {
  .game-root { background: #fff; color: #000; }
}
