/* ═══════════════════════════════════════════════
   🐮 小游戏乐园 v3.0 · 开心牧场主题
   天空蓝 × 草地绿 × 阳光黄 · 描边卡通 + 硬阴影按键
   类名与 v2 全兼容（JS 零改动换肤）
   ═══════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body.g-page {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  color: #2b5e8c;
  background: linear-gradient(180deg, #57bcff 0%, #9fdcff 42%, #e8f7ff 66%, #d0f6c9 66.5%, #8fe89d 100%);
  background-attachment: fixed;
}
body.g-page::before {
  content: ""; position: fixed; left: 6%; top: 40px; width: 130px; height: 40px;
  background: rgba(255, 255, 255, .85); border-radius: 999px;
  box-shadow: 40px -18px 0 -6px rgba(255, 255, 255, .85), 85px 4px 0 -10px rgba(255, 255, 255, .7);
  animation: gCloud 26s linear infinite; pointer-events: none; z-index: 0;
}
body.g-page::after {
  content: ""; position: fixed; right: -60px; top: 130px; width: 170px; height: 52px;
  background: rgba(255, 255, 255, .7); border-radius: 999px;
  box-shadow: 50px -22px 0 -8px rgba(255, 255, 255, .75), -60px 10px 0 -12px rgba(255, 255, 255, .6);
  animation: gCloud 38s linear infinite reverse; pointer-events: none; z-index: 0;
}
@keyframes gCloud { from { transform: translateX(-30vw); } to { transform: translateX(110vw); } }
body.g-page > * { position: relative; z-index: 1; }
/* 弹窗层与彩带层必须 fixed 全屏（specificity 2 类 1 元素，压过上面的通配规则） */
body.g-page > .g-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 300; }
body.g-page > #gConfetti { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 500; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─── 顶栏 ─── */
.g-top {
  display: flex; align-items: center; gap: 11px;
  width: calc(100% - 24px); max-width: 760px;
  margin: 14px auto 0; padding: 10px 14px;
  border-radius: 24px; background: #fff;
  border: 3px solid #2b5e8c;
  box-shadow: 0 6px 0 rgba(43, 94, 140, .25);
}
.g-back {
  flex-shrink: 0; padding: 8px 15px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 900; color: #fff;
  background: #5cb8ff; border: 2.5px solid #2b5e8c;
  box-shadow: 0 4px 0 rgba(43, 94, 140, .3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.g-back:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(43, 94, 140, .3); }
.g-mascot {
  position: relative; width: 54px; height: 54px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 18px;
  background: #ffd54d; border: 3px solid #2b5e8c;
  box-shadow: 0 4px 0 rgba(43, 94, 140, .28);
}
.g-mascot i {
  position: absolute; right: -5px; top: -5px; width: 15px; height: 15px; border-radius: 50%;
  background: #ff7eb0; border: 2.5px solid #2b5e8c;
  animation: gBlink 2.4s ease-in-out infinite;
}
@keyframes gBlink { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.g-title { font-size: 21px; font-weight: 900; line-height: 1.1; color: #2b5e8c; text-shadow: 1.5px 1.5px 0 rgba(43, 94, 140, .15); }
.g-title small { display: block; font-size: 11.5px; font-weight: 800; color: #4a7bab; text-shadow: none; }
.g-topbtns { margin-left: auto; display: flex; gap: 8px; }
.g-ico-btn {
  width: 44px; height: 44px; border-radius: 14px; font-size: 19px;
  background: #fff; border: 2.5px solid #2b5e8c;
  box-shadow: 0 4px 0 rgba(43, 94, 140, .25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.g-ico-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(43, 94, 140, .25); }
.g-ico-btn.off { opacity: .45; filter: grayscale(.8); }

/* ─── 防沉迷 ─── */
.g-anti {
  width: calc(100% - 24px); max-width: 760px; margin: 10px auto 0;
  padding: 0 8px;
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
}
.g-anti-txt {
  padding: 5px 13px; border-radius: 999px;
  font-size: 11.5px; font-weight: 900; color: #fff;
  background: #ff5e3a; border: 2px solid #2b5e8c;
  box-shadow: 0 3px 0 rgba(43, 94, 140, .28);
}
.g-anti-bar {
  width: 110px; height: 14px; border-radius: 99px;
  background: #fff; border: 2.5px solid #2b5e8c; overflow: hidden;
}
.g-anti-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #6fd97f, #ffd54d);
  transition: width .4s ease;
}
.g-anti-bar i.hot { background: linear-gradient(90deg, #ff8a5c, #ff5e5e); }

/* ─── 主体 ─── */
.g-main { width: calc(100% - 24px); max-width: 760px; margin: 0 auto; padding: 12px 0 calc(40px + env(safe-area-inset-bottom)); }
.g-view[hidden] { display: none !important; }

/* ─── 描边卡通按钮（硬阴影按键） ─── */
.g-btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px; text-decoration: none;
  font-size: 15px; font-weight: 900; color: #2b5e8c; background: #fff;
  border: 2.5px solid #2b5e8c;
  box-shadow: 0 5px 0 rgba(43, 94, 140, .28);
  text-align: center; transition: transform .12s ease, box-shadow .12s ease;
}
.g-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(43, 94, 140, .28); }
.g-btn-primary {
  color: #fff; background: linear-gradient(180deg, #ff9a3c, #ff5e3a);
  box-shadow: 0 5px 0 rgba(43, 94, 140, .28), inset 0 3px 6px rgba(255, 255, 255, .4);
  text-shadow: 1px 1px 0 rgba(43, 94, 140, .25);
}
.g-btn-ghost { color: #2b5e8c; background: #eaf6ff; }
.g-btn-sm { padding: 7px 14px; font-size: 12.5px; }

/* ─── Hero 游乐园门牌 ─── */
.g-hero {
  position: relative; display: flex; align-items: center; gap: 13px;
  padding: 20px 20px 24px; border-radius: 28px; overflow: hidden;
  background: linear-gradient(180deg, #7cc8ff 0%, #a8dcff 70%);
  border: 3px solid #2b5e8c;
  box-shadow: 0 7px 0 rgba(43, 94, 140, .25);
  color: #fff;
}
.g-hero::before {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -34px; height: 52px;
  background: #6fd97f; border-radius: 50% 50% 0 0;
  border-top: 3px solid #3fae57;
}
.g-hero::after {
  content: ""; position: absolute; right: 18px; top: 14px; width: 34px; height: 34px;
  border-radius: 50%; background: #ffd54d; border: 3px solid #2b5e8c;
  box-shadow: 0 0 0 8px rgba(255, 213, 77, .35);
  animation: gSun 3.2s ease-in-out infinite alternate;
}
@keyframes gSun { from { transform: rotate(0deg); } to { transform: rotate(14deg) scale(1.06); } }
.g-hero-cow {
  width: 66px; height: 66px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 24px; background: #fff;
  border: 3px solid #2b5e8c;
  box-shadow: 0 5px 0 rgba(43, 94, 140, .28);
  animation: gCowBob 2.6s ease-in-out infinite; z-index: 1;
}
@keyframes gCowBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.g-hero-txt { z-index: 1; text-shadow: 1.5px 1.5px 0 rgba(43, 94, 140, .3); }
.g-hero-txt b { display: block; font-size: 18px; font-weight: 900; letter-spacing: .5px; }
.g-hero-txt span { font-size: 13px; opacity: .95; font-weight: 800; }
.g-hero-star {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; background: #fff;
  border: 2.5px solid #2b5e8c; box-shadow: 0 4px 0 rgba(43, 94, 140, .28);
  font-weight: 900; font-size: 16px; color: #2b5e8c; z-index: 1;
}
.g-hero-star em { font-style: normal; color: #e8940a; }

/* ─── 今日挑战 ─── */
.g-today {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 11px 14px; border-radius: 20px; flex-wrap: wrap;
  background: #fff; border: 3px solid #2b5e8c;
  box-shadow: 0 6px 0 rgba(43, 94, 140, .22);
}
.g-today-title { font-size: 12.5px; font-weight: 900; color: #ff8a5c; }
.g-today-item {
  display: flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #4a7bab; background: #eef6ff;
  border: 2px solid #c9e4f7;
}
.g-today-item b { color: #2b5e8c; }
.g-today-item.done { color: #1f9e55; background: #e2f9e9; border-color: #6fd97f; }
.g-today-item.done b { color: #1f9e55; }
.g-today-item i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #c9e4f7; background: #fff; }
.g-today-item.done i { border-color: #1f9e55; background: #1f9e55 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path d="M3 7.5 L6 10 L11 4" stroke="white" stroke-width="2.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') center/10px no-repeat; }

/* ─── 卡片墙 ─── */
.g-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.g-cards-todo { grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 430px) { .g-cards-todo { grid-template-columns: repeat(2, 1fr); } }
.g-card {
  position: relative; display: flex; flex-direction: column;
  padding: 0 0 14px; border-radius: 26px; background: #fff; overflow: hidden;
  border: 3px solid #2b5e8c;
  box-shadow: 0 7px 0 rgba(43, 94, 140, .25);
  transition: transform .15s ease, box-shadow .15s ease; text-align: left;
}
.g-card:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(43, 94, 140, .25); }
/* 图标悬浮摇摆 */
@keyframes gIcoWiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@media (hover: hover) {
  .g-card:hover .g-card-ico { animation: gIcoWiggle .5s ease-in-out infinite; }
}
/* 卡片顶部彩条加光泽 */
.g-card::after {
  content: ""; position: absolute; top: 10px; left: 6%; width: 34%; height: 4px;
  border-radius: 99px; background: rgba(255, 255, 255, .55); pointer-events: none;
}
.g-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px;
  border-bottom: 3px solid #2b5e8c;
  background: var(--gc2, linear-gradient(90deg, #6a5cff, #a86bff));
}
.g-card-ico {
  width: 62px; height: 62px; margin: 24px auto 0; display: grid; place-items: center;
  border-radius: 21px;
  background: var(--gc2, linear-gradient(135deg, #6a5cff, #a86bff));
  border: 3px solid #2b5e8c;
  box-shadow: 0 5px 0 rgba(43, 94, 140, .3), inset 0 2px 4px rgba(255, 255, 255, .5);
}
.g-card-name { margin: 12px auto 0; font-size: 17px; font-weight: 900; color: #2b5e8c; }
.g-card-desc { margin: 5px 15px 0; font-size: 12px; line-height: 1.6; color: #4a7bab; font-weight: 700; text-align: center; min-height: 19px; }
.g-card-tags { display: flex; justify-content: center; gap: 6px; margin: 10px 10px 0; flex-wrap: wrap; }
.g-card-tags i {
  padding: 3px 11px; border-radius: 999px; font-size: 10.5px; font-style: normal; font-weight: 900;
  color: #2b5e8c; background: #eef6ff; border: 2px solid #c9e4f7;
}
.g-card-tags i.hot { color: #fff; background: #ff4d94; border-color: #2b5e8c; }
.g-card-play {
  margin: 14px 15px 0; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 900;
  color: #fff; text-align: center;
  background: var(--gc2, linear-gradient(90deg, #6a5cff, #a86bff));
  border: 2.5px solid #2b5e8c;
  box-shadow: 0 4px 0 rgba(43, 94, 140, .3), inset 0 2px 3px rgba(255, 255, 255, .4);
  text-shadow: 1px 1px 0 rgba(43, 94, 140, .25);
}
.g-card-soon { opacity: .85; cursor: pointer; }
.g-card-soon::before { background: #d9e8f5; }
.g-card-soon i {
  margin: 13px auto 0; padding: 3px 14px; border-radius: 999px; font-size: 11px; font-style: normal;
  font-weight: 900; color: #4a7bab; background: #eef6ff; border: 2px solid #c9e4f7;
}
.g-card-soon .g-card-ico {
  background: linear-gradient(135deg, #e8f2fb, #d5e8f7);
  box-shadow: 0 5px 0 rgba(43, 94, 140, .18);
}
.g-card-off { opacity: .55; pointer-events: none; }

/* ─── 游戏内公共 ─── */
.g-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.g-head b { font-size: 16px; font-weight: 900; color: #2b5e8c; text-shadow: 1px 1px 0 rgba(255, 255, 255, .8); }
.g-head button:last-of-type, .g-head .g-btn:last-of-type { margin-left: auto; }
.g-panel {
  padding: 13px 15px; border-radius: 22px; background: #fff;
  border: 3px solid #2b5e8c;
  box-shadow: 0 6px 0 rgba(43, 94, 140, .22);
}
.g-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-row + .g-row { margin-top: 10px; }
.g-row label { font-size: 12.5px; font-weight: 800; color: #4a7bab; }
.g-row-sub { justify-content: space-between; }
.g-sel {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 13px;
  border: 2.5px solid #2b5e8c; font-size: 13px; font-weight: 800;
  color: #2b5e8c; background: #eef6ff; outline: none;
}
.g-sel:focus { background: #fff; }
.g-sel-tight { flex: 0 0 auto; width: auto; padding: 6px 9px; font-size: 12px; }
.g-switch { display: flex; align-items: center; gap: 6px; font-size: 12.5px !important; color: #2b5e8c !important; cursor: pointer; }
.g-switch input { width: 18px; height: 18px; accent-color: #ff8a5c; }

/* ─── 五子棋 ─── */
.gk-status { margin: 11px 2px 7px; font-size: 14px; font-weight: 900; color: #2b5e8c; text-align: center; text-shadow: 1px 1px 0 rgba(255, 255, 255, .8); }
.gk-wrap {
  display: grid; place-items: center; padding: 14px; border-radius: 28px;
  background: #fff; border: 3px solid #2b5e8c;
  box-shadow: 0 7px 0 rgba(43, 94, 140, .25);
}
.gk-board {
  --cs: min(88vw, 440px);
  width: var(--cs); height: var(--cs);
  display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55) 0%, transparent 50%),
    linear-gradient(140deg, #ffe8b8 0%, #f7cd85 45%, #eab266 100%);
  border-radius: 16px; padding: 3px;
  border: 3px solid #a87234;
  box-shadow: inset 0 2px 10px rgba(160, 100, 20, .35);
}
.gk-cell { position: relative; }
.gk-cell::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  border-right: 1px solid rgba(146, 92, 24, .4); border-bottom: 1px solid rgba(146, 92, 24, .4);
}
.gk-dot {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; width: 14%; height: 14%;
  border-radius: 50%; background: rgba(146, 92, 24, .6); pointer-events: none;
}
.gk-stone {
  position: absolute; top: 10%; left: 10%; right: 10%; bottom: 10%; display: grid; place-items: center;
  border-radius: 50%; z-index: 2;
  animation: gkDrop .28s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes gkDrop { 0% { transform: scale(.3) translateY(-18px); opacity: .2; } 100% { transform: scale(1) translateY(0); opacity: 1; } }
.gk-p-black {
  background: radial-gradient(circle at 32% 28%, #9b6fd8 0%, #5b3cc4 45%, #2a1a66 100%);
  border: 2.5px solid #1d1046;
  box-shadow: 0 3px 0 rgba(29, 16, 70, .4), inset 0 2px 4px rgba(255, 255, 255, .4);
}
.gk-p-white {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #fff7fb 45%, #ffd6e8 100%);
  border: 2.5px solid #e05688;
  box-shadow: 0 3px 0 rgba(224, 86, 136, .35), inset 0 2px 4px rgba(255, 255, 255, .9);
}
.gk-p { pointer-events: none; }
.gk-cell-win .gk-stone { animation: gkWin .55s ease-in-out infinite alternate; }
@keyframes gkWin { from { transform: scale(1); } to { transform: scale(1.2); filter: brightness(1.15) saturate(1.25); } }
.gk-last .gk-stone::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: #ff5e5e; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(255, 94, 94, .5);
}
/* 小牛提示脉冲 */
.gk-hint { animation: gkHintPulse .8s ease-in-out infinite; z-index: 3; }
@keyframes gkHintPulse { 0%, 100% { box-shadow: inset 0 0 0 3px #ffd54d; } 50% { box-shadow: inset 0 0 0 3px #ff8a5c; } }
.gk-piece-legend { display: flex; justify-content: center; gap: 22px; margin-top: 11px; font-size: 12.5px; font-weight: 800; color: #4a7bab; }
.gk-p { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin: 0 4px; vertical-align: middle; }
.gk-stone .g-svg, .gk-p .g-svg { width: 78%; height: 78%; margin: auto; }

/* ─── 消消乐 ─── */
.m3-hud {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 6px; margin-bottom: 11px;
  border-radius: 18px; background: #fff;
  border: 3px solid #2b5e8c;
  box-shadow: 0 5px 0 rgba(43, 94, 140, .22);
  font-size: 12px; font-weight: 800; color: #4a7bab; text-align: center;
}
.m3-hud b { color: #ff5e3a; font-size: 15px; }
.m3-lvsel {
  padding: 5px 11px; border-radius: 999px; border: 2.5px solid #2b5e8c;
  font-size: 13px; font-weight: 900; color: #2b5e8c; background: #fff; outline: none;
  box-shadow: 0 3px 0 rgba(43, 94, 140, .25);
}
.m3-board {
  width: min(88vw, 440px); height: min(88vw, 440px);
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  gap: 4px; padding: 9px; border-radius: 26px; position: relative;
  background: #fff; border: 3px solid #2b5e8c; overflow: hidden;
  box-shadow: 0 7px 0 rgba(43, 94, 140, .25), inset 0 2px 8px rgba(43, 94, 140, .08);
}
.m3-cell {
  position: relative; overflow: hidden;
  min-width: 0; min-height: 0;
  display: grid; place-items: center; border-radius: 14px;
  background: #fff; cursor: pointer; user-select: none;
  border: 2px solid rgba(43, 94, 140, .16);
  box-shadow: inset 0 4px 8px rgba(255, 255, 255, .75), inset 0 -4px 8px rgba(43, 94, 140, .07);
  transition: transform .15s ease, box-shadow .15s ease;
}
/* 糖果高光：左上椭圆光泽 */
.m3-cell::after {
  content: ""; position: absolute; left: 8%; top: 6%; width: 42%; height: 26%;
  border-radius: 50%; background: rgba(255, 255, 255, .55); pointer-events: none;
}
/* 图标绝对定位：不参与布局尺寸计算，防止 SVG 默认 150px 高把棋盘撑爆 */
.m3-cell .g-svg { position: absolute; left: 14%; top: 14%; width: 72%; height: 72%; margin: 0; }
.m3-cell[data-k="0"] { background: #ffddc4; border-color: #ff9a5c; }
.m3-cell[data-k="1"] { background: #ffeda6; border-color: #f0b62e; }
.m3-cell[data-k="2"] { background: #cfe9ff; border-color: #5caeef; }
.m3-cell[data-k="3"] { background: #d2f6d4; border-color: #52c465; }
.m3-cell[data-k="4"] { background: #e5d6ff; border-color: #a678f0; }
.m3-cell[data-k="5"] { background: #ffd9ea; border-color: #ff6aa8; }
.m3-cell.sel { transform: scale(1.15); border-color: #ff5e5e; box-shadow: 0 0 0 3px #ff5e5e !important; z-index: 2; }
.m3-cell.hint { animation: m3HintA .8s ease-in-out infinite; }
@keyframes m3HintA { 0%, 100% { box-shadow: 0 0 0 3px #ffd54d; } 50% { box-shadow: 0 0 0 3px #ff8a5c; transform: scale(1.08); } }
.m3-cell.clear { animation: m3Pop .32s ease forwards; }
@keyframes m3Pop { 40% { transform: scale(1.3); filter: brightness(1.4) saturate(1.3); } 100% { transform: scale(0); opacity: 0; } }
.m3-cell.drop { animation: m3Fall .26s ease-in; }
@keyframes m3Fall { from { transform: translateY(-70%); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
.m3-combo {
  position: absolute; left: 50%; top: 42%; z-index: 5; pointer-events: none;
  padding: 8px 20px; border-radius: 999px;
  font-size: 20px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #ff9a3c, #ff5e3a);
  border: 3px solid #2b5e8c;
  box-shadow: 0 5px 0 rgba(43, 94, 140, .3);
  text-shadow: 1.5px 1.5px 0 rgba(43, 94, 140, .3);
  animation: m3ComboA .9s ease forwards;
}
@keyframes m3ComboA {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  75% { transform: translate(-50%, -70%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -115%) scale(.85); opacity: 0; }
}
.m3-tips {
  margin-top: 12px; padding: 9px 14px; border-radius: 14px;
  font-size: 12px; line-height: 1.8; color: #4a7bab; text-align: center;
  background: rgba(255, 255, 255, .85);
}

/* ─── 战绩面板 ─── */
.gp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gp-stat {
  padding: 16px 8px; border-radius: 20px; background: #fff; text-align: center;
  border: 3px solid #2b5e8c;
  box-shadow: 0 6px 0 rgba(43, 94, 140, .22);
}
.gp-stat b { display: block; font-size: 24px; font-weight: 900; color: #ff5e3a; text-shadow: 1px 1px 0 rgba(43, 94, 140, .15); }
.gp-stat small { font-size: 11.5px; font-weight: 800; color: #4a7bab; }
.gp-rows { margin-top: 15px; }
.gp-row {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; margin-bottom: 9px;
  border-radius: 16px; background: #fff;
  border: 2.5px solid #2b5e8c;
  box-shadow: 0 4px 0 rgba(43, 94, 140, .18);
  font-size: 12.5px; font-weight: 700; color: #2b5e8c;
}
.gp-row .gp-r { margin-left: auto; }
.gp-win { color: #1f9e55; } .gp-lose { color: #e04b4b; } .gp-draw { color: #d69a00; } .gp-finish { color: #6a5cff; }

/* ─── 数独 ─── */
.sd-board {
  width: min(88vw, 340px); height: min(88vw, 340px); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr);
  gap: 5px; padding: 10px; border-radius: 24px; position: relative;
  background: linear-gradient(160deg, #eaf4ff, #d5e8ff);
  border: 3px solid #2b5e8c; box-shadow: 0 7px 0 rgba(43, 94, 140, .25);
}
.sd-cell {
  display: grid; place-items: center; border-radius: 12px;
  background: #fff; border: 2px solid rgba(43, 94, 140, .18);
  font-size: 26px; font-weight: 900; color: #2b5e8c; cursor: pointer; user-select: none;
  transition: transform .12s ease, background .12s ease;
}
.sd-cell.sd-fix { background: #e3effc; color: #46648e; cursor: default; }
.sd-cell.sd-empty { background: #fffdf2; }
.sd-cell.sd-sel { background: #fff1c2; border-color: #f0b62e; transform: scale(1.06); box-shadow: 0 0 0 3px #ffd54d; }
.sd-cell.sd-bad { color: #e04b4b; border-color: #e04b4b; animation: sdBad .5s ease infinite; }
@keyframes sdBad { 0%, 100% { background: #fff; } 50% { background: #ffdcdc; transform: scale(1.05); } }
.sd-pad { display: flex; gap: 10px; justify-content: center; margin: 16px 0 4px; flex-wrap: wrap; }
.sd-key {
  min-width: 62px; padding: 12px 16px; font-size: 22px; font-weight: 900; color: #fff;
  border: 3px solid #2b5e8c; border-radius: 18px; cursor: pointer; outline: none;
  background: linear-gradient(180deg, #5cb8ff, #2f8fe8);
  box-shadow: 0 5px 0 rgba(43, 94, 140, .3), inset 0 3px 6px rgba(255, 255, 255, .4);
  text-shadow: 1px 1px 0 rgba(43, 94, 140, .3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.sd-key:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(43, 94, 140, .3); }
.sd-key.sd-erase { font-size: 15px; background: linear-gradient(180deg, #ffb02e, #ff8a2e); min-width: 90px; }

/* ─── 迷宫 ─── */
.mz-board {
  width: min(92vw, 460px); height: min(92vw, 460px); margin: 0 auto;
  display: grid; gap: 0; padding: 8px; border-radius: 22px;
  background: #fffef2; border: 3px solid #2b5e8c;
  box-shadow: 0 7px 0 rgba(43, 94, 140, .25);
}
.mz-cell {
  position: relative; overflow: hidden;
  min-width: 0; min-height: 0;
  display: grid; place-items: center;
  border-top: 3px solid #c9a35c; border-right: 3px solid #c9a35c;
  border-bottom: 3px solid #c9a35c; border-left: 3px solid #c9a35c;
  margin-top: -3px; margin-left: -3px;
}
.mz-cell.mz-t { border-top-color: #8a6a2e; border-top-width: 4px; }
.mz-cell.mz-r { border-right-color: #8a6a2e; border-right-width: 4px; }
.mz-cell.mz-b { border-bottom-color: #8a6a2e; border-bottom-width: 4px; }
.mz-cell.mz-l { border-left-color: #8a6a2e; border-left-width: 4px; }
.mz-cell.mz-goal { background: linear-gradient(160deg, #fff3c2, #ffe89a); }
.mz-cell.mz-goal .g-svg { width: 74%; height: 74%; animation: mzGoalGlow 1.1s ease-in-out infinite; }@keyframes mzGoalGlow { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #ffb02e); } 50% { transform: scale(1.18); filter: drop-shadow(0 0 8px #ffb02e); } }
.mz-cell.mz-me { background: #dcf5dd; }
.mz-cell.mz-me .g-svg { width: 78%; height: 78%; animation: mzHop .4s ease; }
@keyframes mzHop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.mz-pad { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 16px 0 4px; }
.mz-pad-mid { display: flex; gap: 10px; }
.mz-key {
  width: 64px; height: 54px; font-size: 20px; font-weight: 900; color: #fff;
  border: 3px solid #2b5e8c; border-radius: 16px; cursor: pointer; outline: none;
  background: linear-gradient(180deg, #5ed02f, #2fae5e);
  box-shadow: 0 5px 0 rgba(43, 94, 140, .3), inset 0 3px 6px rgba(255, 255, 255, .4);
  text-shadow: 1px 1px 0 rgba(43, 94, 140, .3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.mz-key:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(43, 94, 140, .3); }

/* ─── 记忆翻牌 ─── */
.mm-board {
  width: min(92vw, 440px); margin: 0 auto; padding: 10px; border-radius: 24px;
  display: grid; gap: 9px;
  background: linear-gradient(160deg, #fff, #fff4e3);
  border: 3px solid #2b5e8c; box-shadow: 0 7px 0 rgba(43, 94, 140, .25);
}
.mm-card { aspect-ratio: 1/1; perspective: 500px; cursor: pointer; }
.mm-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .4s ease;
}
.mm-card.mm-open .mm-inner { transform: rotateY(180deg); }
.mm-face {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-items: center; border-radius: 14px; border: 2.5px solid #2b5e8c;
}
.mm-back {
  background: linear-gradient(160deg, #8a5ce8, #5c8ae8);
  color: #fff; font-size: 22px; font-weight: 900;
  box-shadow: inset 0 3px 8px rgba(255, 255, 255, .35), 0 4px 0 rgba(43, 94, 140, .25);
}
.mm-front {
  background: #fff; transform: rotateY(180deg);
  box-shadow: inset 0 0 0 3px rgba(255, 176, 46, .5);
}
.mm-front .g-svg { width: 66%; height: 66%; }
.mm-card.mm-open .mm-front { background: #e9fbef; box-shadow: inset 0 0 0 3px #2fb56b, 0 0 10px rgba(47, 181, 107, .5); }

/* ─── 接水管 ─── */
.pp-board {
  width: min(92vw, 400px); height: min(92vw, 400px); margin: 0 auto;
  display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr);
  gap: 3px; padding: 8px; border-radius: 22px;
  background: #f4f8fc; border: 3px solid #2b5e8c;
  box-shadow: 0 7px 0 rgba(43, 94, 140, .25);
}
.pp-cell {
  position: relative; border-radius: 9px; background: #fff; cursor: pointer;
  border: 2px solid rgba(43, 94, 140, .14);
  transition: background .15s ease;
}
.pp-cell:active { background: #eaf4ff; }
.pp-src { background: #dbeeff; }
.pp-dst { background: #fff3c2; }
.pp-cell.pp-src::before { content: "🚰"; position: absolute; right: 2px; bottom: 1px; font-size: 12px; z-index: 2; }
.pp-cell.pp-dst::before { content: "🏆"; position: absolute; left: 2px; top: 1px; font-size: 12px; z-index: 2; }
.pp-svg { width: 100%; height: 100%; display: block; }
.pp-svg line { stroke: #5a7ba6; stroke-width: 11; stroke-linecap: round; transition: stroke .25s ease; }
.pp-svg circle { fill: #5a7ba6; stroke: #fff; stroke-width: 2.5; transition: fill .25s ease; }
.pp-cell.pp-flow { background: #e6f9ec; }
.pp-cell.pp-flow .pp-svg line { stroke: #2fb56b; }
.pp-cell.pp-flow .pp-svg circle { fill: #2fb56b; animation: ppPump .9s ease-in-out infinite; }
@keyframes ppPump { 0%, 100% { r: 6; } 50% { r: 7.5; } }
.pp-cell.pp-flow { animation: ppFlowGlow 1.2s ease-in-out infinite; }
@keyframes ppFlowGlow { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(47, 181, 107, .3); } 50% { box-shadow: inset 0 0 8px 2px rgba(47, 181, 107, .45); } }

/* ─── 弹窗 / 小牛引导 ─── */
.g-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(43, 94, 140, .55); backdrop-filter: blur(5px);
}
/* 弹窗盒 margin auto 双保险：即使 flex 居中失效也居中 */
.g-mask .g-mask-box, .g-mask .g-cow-box { margin: auto; }
.g-mask[hidden], .g-anti[hidden] { display: none !important; }
.g-mask-sticky { z-index: 400; }
.g-mask-box, .g-cow-box {
  max-width: 340px; width: 100%; padding: 26px 24px; border-radius: 30px; text-align: center;
  background: #fff; border: 3px solid #2b5e8c;
  box-shadow: 0 8px 0 rgba(43, 94, 140, .3);
  animation: gCowIn .3s cubic-bezier(.34, 1.56, .64, 1);
}
.g-cow-box { background: linear-gradient(165deg, #fffef2 0%, #fff3f8 100%); position: relative; overflow: hidden; }
/* 弹窗顶部彩虹条 */
.g-cow-box::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background: linear-gradient(90deg, #ff5e3a, #ffb02e, #6fd97f, #5cb8ff, #9d7bff, #ff7eb0);
}
.g-mask-box { position: relative; overflow: hidden; }
.g-mask-box::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background: linear-gradient(90deg, #5cb8ff, #6fd97f, #ffb02e, #ff5e3a);
}
@keyframes gCowIn { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.g-mask-box b, .g-cow-box b { display: block; margin-top: 10px; font-size: 18px; font-weight: 900; color: #2b5e8c; }
.g-mask-box p { margin: 10px 0 16px; font-size: 13.5px; line-height: 1.8; color: #4a7bab; }
.g-cow-box p { margin: 10px 0 14px; font-size: 14px; line-height: 1.85; color: #4a7bab; }
.g-mask-cow, .g-cow-big {
  width: 80px; height: 80px; margin: 0 auto; display: grid; place-items: center;
  border-radius: 26px; background: #ffd54d;
  border: 3px solid #2b5e8c;
  box-shadow: 0 5px 0 rgba(43, 94, 140, .28);
}
.g-cow-star { font-size: 30px; margin-bottom: 10px; animation: gStarSpin 1.2s ease-in-out; }
@keyframes gStarSpin { from { transform: scale(0) rotate(-360deg); } to { transform: scale(1) rotate(0); } }
.g-cow-box .g-btn { width: 100%; }

/* ─── SVG 图标通用 ─── */
.g-svg { display: block; width: 100%; height: 100%; fill: none; }
.g-mascot .g-svg-cow, .g-cow-big .g-svg-big, .g-mask-cow .g-svg-big { width: 76%; height: 76%; margin: auto; }
.g-svg-ico { width: 36px; height: 36px; margin: auto; }
.g-svg-hero { width: 48px; height: 48px; }
.g-svg-star { width: 22px; height: 22px; }

/* ─── 彩带 / 降级 / 电脑端 ─── */
#gConfetti { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 500; pointer-events: none; }
body.g-fx-off * { animation: none !important; transition: none !important; }
@media (min-width: 700px) {
  .g-top { margin-top: 18px; }
  .g-title { font-size: 24px; }
  .g-cards { gap: 20px; }
  .gk-board { --cs: min(560px, 62vh); }
  .m3-board { width: min(560px, 62vh); height: min(560px, 62vh); }
  .m3-cell .g-svg { left: 18%; top: 18%; width: 64%; height: 64%; }
  .g-card:hover { transform: translateY(-4px); box-shadow: 0 10px 0 rgba(43, 94, 140, .3); }
  .g-card:hover:active { transform: translateY(0); }
}

/* ═══════════ v4.0.1 迷宫渲染修复 + 超级鲜艳贴纸卡通 ═══════════ */
/* 迷宫图标绝对定位（与消消乐同款手法：不参与布局计算防撑爆） */
.mz-cell .g-svg { position: absolute; left: 12%; top: 12%; width: 76%; height: 76%; margin: 0; }
.mz-board { background: #fffbe0; }
.mz-cell.mz-me { background: #b6f2c0; }
.mz-cell.mz-goal { background: linear-gradient(160deg, #ffd94d, #ffc32e); }
.mz-key { background: linear-gradient(180deg, #74e332, #2fb844); }

/* 天空草地：彩虹级饱和 */
body.g-page {
  background: linear-gradient(180deg, #2fa8ff 0%, #6fd2ff 40%, #d9f7ff 62%, #ffed9e 70%, #a5ef8f 78%, #62dd72 100%);
}
body.g-page::before { background: rgba(255, 255, 255, .95); box-shadow: 0 12px 0 -3px rgba(255, 255, 255, .85); }
body.g-page::after { background: rgba(255, 255, 255, .9); box-shadow: 0 9px 0 -3px rgba(255, 255, 255, .8); }

/* 贴纸字：白字 + 深蓝描边 + 彩虹底影（标题全部应用） */
.g-title, .g-head b {
  color: #fff;
  text-shadow: 2px 0 0 #2b5e8c, -2px 0 0 #2b5e8c, 0 2.5px 0 #2b5e8c, 0 -2.5px 0 #2b5e8c,
    1.5px 1.5px 0 #2b5e8c, -1.5px 1.5px 0 #2b5e8c, 1.5px -1.5px 0 #2b5e8c, -1.5px -1.5px 0 #2b5e8c,
    4px 4px 0 rgba(255, 118, 68, .55);
}

/* 按钮/状态条/说明条糖果化 */
.g-btn-primary { background: linear-gradient(180deg, #ff7a2e, #ff3d2e); }
.gk-status, .g-row > label, .g-head {
  color: #2b5e8c;
}
.gk-status {
  background: linear-gradient(90deg, #fff6c8, #ffe3f1) !important;
  border: 2.5px solid #ff8a3c;
  box-shadow: 0 4px 0 rgba(255, 138, 60, .3);
  font-weight: 900;
}
.m3-tips {
  background: linear-gradient(165deg, #fffdf2 55%, #fff0f6 100%);
  border: 2.5px solid #ffb02e;
  box-shadow: 0 5px 0 rgba(255, 176, 46, .28), inset 0 2px 0 rgba(255, 255, 255, .8);
}
.m3-tips b { color: #ff5e3a; }

/* 卡片墙：糖果渐变底 + 更艳顶条 */
.g-card {
  background: linear-gradient(165deg, #ffffff 55%, #fff7e8 88%, #ffeef5 100%);
}
.g-card::before { height: 12px; }

/* 接水管更亮 */
.pp-board { background: #eef7ff; }
.pp-svg line { stroke: #3f8fd9; }
.pp-svg circle { fill: #3f8fd9; }
.pp-cell.pp-flow .pp-svg line { stroke: #22c55e; }
.pp-cell.pp-flow .pp-svg circle { fill: #22c55e; }

/* 数独/翻牌面板底色提亮 */
.sd-board { background: linear-gradient(160deg, #e2f2ff, #c5e5ff); }
.mm-board { background: linear-gradient(160deg, #ffffff, #ffedd0); }
.mm-back { background: linear-gradient(160deg, #a45ce8, #4a7ce8); }
