/* ============================================================ */
/* 创意工坊 workshop.css：从 style.css 拆出的独立样式模块                       */
/* ============================================================ */


/* ========== 造3开屏 ========== */
.cloud-game-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}

.cloud-game-page.open{transform:translateX(0);}

.cloud-game-header{display:flex;align-items:center;gap:8px;padding:calc(22px + var(--safe-top)) 20px 12px;flex-shrink:0;}

.cloud-game-stage{flex:1;position:relative;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;background:var(--bg);}

.cloud-game-bg{position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;will-change:transform;}

.cloud-game-bg-icon{position:absolute;left:0;top:0;stroke:var(--accent);fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;display:block;}

.cloud-game-ground{position:absolute;left:0;right:0;bottom:60px;height:42px;pointer-events:none;}

.cloud-game-ground-line{position:absolute;left:0;right:0;top:0;height:2px;background:var(--accent);opacity:.9;}

.cloud-game-ground-fill{position:absolute;left:0;right:0;top:2px;bottom:0;background:var(--accent);opacity:.22;}

.cloud-game-pet{position:absolute;left:0;top:0;width:56px;height:56px;will-change:transform;pointer-events:none;}

.cloud-game-pet svg{width:100%;height:100%;display:block;}

.cloud-game-cloud{position:absolute;left:0;top:0;width:60px;height:30px;will-change:transform;pointer-events:none;}


.cloud-game-cloud::before{content:'';position:absolute;left:0;bottom:0;width:60px;height:18px;border-radius:9px;background:var(--bg);border:1px solid var(--accent);box-sizing:border-box;}

.cloud-game-cloud::after{content:'';position:absolute;left:12px;bottom:8px;width:22px;height:22px;border-radius:50%;background:var(--bg);border:1px solid var(--accent);box-sizing:border-box;box-shadow:14px -4px 0 -1px var(--bg),14px -4px 0 0 var(--accent);}

.cloud-game-pet svg{width:100%;height:100%;display:block;}
.cloud-game-score{position:absolute;left:20px;top:calc(22px + var(--safe-top));font-size:22px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;pointer-events:none;z-index:5;}

.cloud-game-combo{position:absolute;left:20px;top:calc(54px + var(--safe-top));font-size:12px;color:var(--accent);font-variant-numeric:tabular-nums;pointer-events:none;opacity:0;transition:opacity .2s;z-index:5;}

.cloud-game-combo.show{opacity:1;}

.cloud-game-best{position:absolute;right:20px;top:calc(22px + var(--safe-top));font-size:13px;color:var(--text-tertiary);font-variant-numeric:tabular-nums;pointer-events:none;z-index:5;letter-spacing:.02em;}

.cloud-game-overlay{position:absolute;inset:0;background:var(--overlay);z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s ease;}

.cloud-game-overlay.open{opacity:1;pointer-events:auto;}

.cloud-game-result{width:80%;max-width:300px;background:var(--bg);border-radius:14px;padding:24px;display:flex;flex-direction:column;gap:10px;text-align:center;}

.cloud-game-result-title{font-size:16px;font-weight:600;color:var(--text);}

.cloud-game-result-score{font-size:34px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1.1;}

.cloud-game-result-sub{font-size:12px;color:var(--text-tertiary);}

.cloud-game-result-reward{font-size:12.5px;color:var(--accent);line-height:1.6;padding:10px 0;border-top:1px solid var(--divider);border-bottom:1px solid var(--divider);}

.cloud-game-result-actions{display:flex;gap:10px;margin-top:6px;}

.cloud-game-result-btn{flex:1;padding:11px;border-radius:8px;font-size:14.5px;font-weight:500;font-family:inherit;cursor:pointer;border:none;}

.cloud-game-result-btn.ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);}

.cloud-game-result-btn.primary{background:var(--accent);color:#fff;}

.cloud-game-hint{position:absolute;left:50%;bottom:60px;transform:translateX(-50%);font-size:11.5px;color:var(--text-tertiary);text-align:center;pointer-events:none;letter-spacing:.02em;z-index:5;}

/* ========== 年龄计算器 end ========== */

/* ========== 别不踩黑块 ========== */
.blocks-game-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}

.blocks-game-page.open{transform:translateX(0);}

.blocks-stage{flex:1;position:relative;display:flex;flex-direction:column;min-height:0;padding:0;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}

.blocks-info{display:flex;justify-content:space-between;align-items:baseline;padding:14px 22px 10px;flex-shrink:0;}

.blocks-score{font-size:30px;font-weight:600;color:var(--accent);font-variant-numeric:tabular-nums;letter-spacing:.02em;line-height:1;}

.blocks-timer{font-size:20px;color:var(--text-tertiary);font-variant-numeric:tabular-nums;letter-spacing:.02em;transition:color .3s ease;}

.blocks-timer.warning{color:var(--danger);}

.blocks-grid-wrap{flex:1;position:relative;overflow:hidden;min-height:0;padding:0;}

.blocks-grid{position:absolute;top:0;left:0;right:0;display:flex;flex-direction:column;gap:var(--blocks-gap,6px);will-change:transform;backface-visibility:hidden;transform:translate3d(0,0,0);}

.blocks-row{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--blocks-gap,8px);height:var(--blocks-row-h,60px);flex-shrink:0;transition:opacity .22s ease,filter .22s ease;}

.blocks-cell{position:relative;background:var(--input-bg);border:1px solid var(--border);border-radius:10px;transition:background .12s ease,border-color .12s ease,box-shadow .12s ease;overflow:hidden;}

.blocks-cell.black{background:var(--accent);border-color:var(--accent);}

/* 空白格底纹：随机普通宠物 SVG，居中、淡、不拦事件。
   黑格命中的瞬间 class 会变 fading 整格淡出，这里不用单独处理。 */
.blocks-cell .blocks-pet{position:absolute;left:50%;top:50%;width:82%;height:82%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;opacity:.13;pointer-events:none;}

.blocks-cell .blocks-pet svg{width:100%;height:100%;display:block;animation:none !important;transition:none !important;}

.blocks-row.judge .blocks-cell{border-width:1.5px;border-color:var(--accent);}

.blocks-row.judge .blocks-cell.black{box-shadow:0 0 10px var(--accent-soft);}

.blocks-row.blur-top,.blocks-row.blur-bottom{opacity:.3;filter:blur(2.5px);}

.blocks-cell.wrong{background:var(--danger)!important;border-color:var(--danger)!important;box-shadow:0 0 14px rgba(225,90,74,.4)!important;}

.blocks-cell.fading{opacity:0.35;transition:opacity .12s ease-out;}

/* blocks-cell.fading 重复已合并 */
.blocks-overlay{position:absolute;inset:0;background:var(--overlay);z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s ease;}

.blocks-overlay.open{opacity:1;pointer-events:auto;}

.blocks-result{position:relative;width:80%;max-width:300px;background:var(--bg);border-radius:14px;padding:26px 24px;display:flex;flex-direction:column;gap:10px;text-align:center;}

.blocks-result-title{font-size:13px;color:var(--text-tertiary);letter-spacing:.12em;}

.blocks-result-score{font-size:52px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1.05;margin:4px 0;}

/* 结算页：宠物绝对定位到弹窗左上角，不参与文档流，
   分数和标题仍按原来的居中排版，不受挤压。
   .blocks-result 已有 padding:26px 24px，所以 top/left 用 14px 让宠物贴近内边距边缘。 */
.blocks-result-pets{position:absolute;top:14px;left:14px;display:flex;align-items:center;gap:4px;}

.blocks-result-pets:empty{display:none;}

.blocks-result-pet{width:36px;height:36px;flex-shrink:0;}

.blocks-result-pet svg{width:100%;height:100%;display:block;animation:none !important;transition:none !important;}

.blocks-result-sub{font-size:12.5px;color:var(--text-tertiary);letter-spacing:.02em;}

.blocks-result-actions{display:flex;gap:10px;margin-top:10px;}

.blocks-result-btn{flex:1;padding:11px;border-radius:8px;font-size:14.5px;font-weight:500;font-family:inherit;cursor:pointer;border:none;}

.blocks-result-btn.ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);}

.blocks-result-btn.primary{background:var(--accent);color:#fff;}


/* ========== 扫雷 ========== */
.mines-game-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}

.mines-game-page.open{transform:translateX(0);}

.mines-stage{flex:1;position:relative;display:flex;flex-direction:column;min-height:0;padding:0;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}

.mines-info{display:flex;justify-content:space-around;align-items:center;padding:14px 22px 8px;flex-shrink:0;}

.mines-info-item{display:flex;flex-direction:column;align-items:center;gap:2px;}

.mines-info-item .num{font-size:20px;font-weight:600;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1;}

.mines-info-item .label{font-size:10.5px;color:var(--text-tertiary);letter-spacing:.04em;}

.mines-difficulty{display:flex;gap:8px;justify-content:center;padding:8px 20px 6px;flex-shrink:0;}

.mines-diff-chip{padding:6px 14px;border-radius:16px;font-size:12.5px;font-family:inherit;color:var(--text-secondary);background:transparent;border:1px solid var(--border);cursor:pointer;transition:all .15s;}

.mines-diff-chip.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:500;}

/* v2.19 存档标记：该难度有一局没玩完时，chip 右上角一个小圆点。
   用绝对定位而不是追加文字节点，避免撑宽 chip 导致四档换行。 */
.mines-diff-chip{position:relative;}

.mines-diff-chip.has-save::after{content:'';position:absolute;top:2px;right:4px;width:5px;height:5px;border-radius:50%;background:var(--accent);}

.mines-records{display:flex;gap:8px;justify-content:center;padding:8px 20px 12px;flex-shrink:0;flex-wrap:wrap;}

.mines-records span{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:10px;background:var(--input-bg);font-size:11.5px;color:var(--text-secondary);font-variant-numeric:tabular-nums;letter-spacing:.02em;}

.mines-records .rec-win{color:var(--accent);font-weight:600;}

.mines-records .rec-lose{color:var(--danger);font-weight:600;}

.mines-hint-row{display:flex;justify-content:center;padding:4px 20px 10px;flex-shrink:0;}

/* 扫蛋顶栏的操作模式切换按钮：经典 / 双击 */
.mines-mode-btn{
  margin-left:auto;
  margin-right:8px;
  padding:6px 14px;
  border-radius:16px;
  font-size:12.5px;
  font-family:inherit;
  color:var(--text-secondary);
  background:transparent;
  border:1px solid var(--border);
  cursor:pointer;
  transition:all .15s;
  flex-shrink:0;
}

.mines-mode-btn:active{opacity:.7;}

.mines-mode-btn.active{
  background:var(--accent-soft);
  border-color:var(--accent);
  color:var(--accent);
  font-weight:500;
}

.mines-hint-btn{padding:8px 20px;border-radius:18px;border:1px solid var(--accent);background:var(--accent-soft);color:var(--accent);font-size:13px;font-family:inherit;font-weight:500;cursor:pointer;letter-spacing:.02em;transition:opacity .15s ease;}

.mines-hint-btn:active{opacity:.7;}

.mines-cell.hinted{border-color:var(--accent);box-shadow:inset 0 0 0 1.5px var(--accent);animation:minesHintPulse 1.2s ease-in-out infinite;}

/* v2.19 长按插旗前的邻格高亮：
   按下瞬间给「被按格 + 周围 8 格（共 9 格）」中尚未翻开的格子加深底色。
   比 .flagged 的常驻态浅一档，避免看起来像「已经插好旗」。 */
.mines-cell.press-hl{border-color:var(--accent);background:var(--accent-soft);}

/* v2.19 已翻开格被按住时的自身按压态：
   周围 9 格里能高亮的只有未翻开的格（revealed 是透明边框 + 页面底色），
   不给被按的已开格单独描一圈，用户会觉得「按了没反应」。 */
.mines-cell.press-src{box-shadow:inset 0 0 0 1.5px var(--accent);border-color:var(--accent);}

.mines-grid-wrap{flex:1;min-height:0;padding:8px 12px 24px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;display:block;}

/* v2.19 横向平移轨道：棋盘比视口宽时靠 translateX 平移，不做吸附、不回弹。
   专家档 16 列 × 30px = 510px 宽，手机上必须能左右平移才看得到右边的列。
   用 flex 而不是 block：子项用 auto 外边距居中 ——
   装得下时把棋盘推向中间，装不下时 auto 外边距自动收成 0，棋盘按自己的
   内容宽度溢出，正好交给 JS 的 translateX 平移。 */
.mines-grid-track{
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  /* 撑满容器宽度，否则棋盘没占满时轨道会塌成内容宽度，居中失效 */
  width:100%;
  touch-action:pan-y;
  will-change:transform;
  user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;
}

/* v2.19 居中 + 不受容器宽度压缩：
   原来这里是 width:fit-content !important + max-width:100% !important。
   max-width:100% 会在棋盘宽于容器时把它压回容器宽度，每列被挤窄，
   专家档的 30px 就白锁了，所以必须去掉。
   改用 flex 子项的 auto 外边距居中；flex:0 0 auto 保证不被压缩，
   行内 width:max-content（JS 里写的）保住真实棋盘宽度，超出部分靠平移查看。 */
.mines-grid{
  display:grid;
  gap:2px;
  flex:0 0 auto;
  margin-left:auto !important;
  margin-right:auto !important;
}

.mines-cell{aspect-ratio:1;display:flex;align-items:center;justify-content:center;border-radius:4px;font-size:var(--mines-font,14px);font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer;background:var(--input-bg);border:1px solid var(--border);color:var(--text);user-select:none;transition:background .12s ease,transform .12s ease;}

.mines-cell.revealed{background:var(--bg);border-color:transparent;cursor:default;}

.mines-cell.hidden:active{transform:scale(.94);}

.mines-cell.flagged{background:var(--accent-soft);border-color:var(--accent);}

.mines-cell.exploded{background:var(--danger);border-color:var(--danger);color:#fff;animation:minesShake .4s ease;}

.mines-cell .mines-egg-svg{width:80%;height:80%;display:block;}

.mines-cell .mines-egg-svg ellipse{stroke:var(--accent);fill:var(--accent);stroke-width:2.5;}

.mines-cell.exploded .mines-egg-svg ellipse{stroke:#fff;fill:#fff;}

.mines-cell .pet-svg{width:80%;height:80%;display:block;transition:none;animation:none;transform:none;}

.mines-cell.num-1{color:#F4A261;}

.mines-cell.num-2{color:#7A9CA5;}

.mines-cell.num-3{color:#8B9DC3;}

.mines-cell.num-4{color:#C9A9A6;}

.mines-cell.num-5{color:#A8B89A;}

.mines-cell.num-6{color:#B8A082;}

.mines-cell.num-7{color:#9B8AA6;}

.mines-cell.num-8{color:#D4A5A5;}

.mines-overlay{position:absolute;inset:0;background:var(--overlay);z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s ease;}

.mines-overlay.open{opacity:1;pointer-events:auto;}

.mines-result{width:80%;max-width:300px;background:var(--bg);border-radius:14px;padding:26px 24px;display:flex;flex-direction:column;gap:10px;text-align:center;}

.mines-result-title{font-size:18px;font-weight:600;color:var(--text);}

.mines-result-sub{font-size:13px;color:var(--text-secondary);line-height:1.7;}

.mines-result-actions{display:flex;gap:10px;margin-top:10px;}

/* ========== 大鱼吃小鱼 ========== */
.fish-game-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}

.fish-game-page.open{transform:translateX(0);}

.fish-game-stage{flex:1;position:relative;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;background:var(--bg);}

.fish-game-score{position:absolute;left:20px;top:calc(22px + var(--safe-top));font-size:22px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;pointer-events:none;z-index:5;line-height:1;}

.fish-game-best{position:absolute;right:20px;top:calc(22px + var(--safe-top));font-size:12.5px;color:var(--text-tertiary);font-variant-numeric:tabular-nums;pointer-events:none;z-index:5;letter-spacing:.02em;}

.fish-game-hint{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);font-size:11.5px;color:var(--text-tertiary);pointer-events:none;letter-spacing:.02em;text-align:center;z-index:5;}

.fish-game-player,.fish-game-enemy{position:absolute;left:0;top:0;width:64px;height:64px;pointer-events:none;will-change:transform;transform-origin:center center;}

.fish-game-player svg,.fish-game-enemy svg{width:100%;height:100%;display:block;animation:none !important;transition:none !important;transform:none !important;}

.fish-game-enemy.seahorse svg{filter:drop-shadow(0 0 6px var(--accent));}

.fish-game-player.fish-pulse svg{animation:fishPulse .18s ease-out !important;}

.fish-game-overlay{position:absolute;inset:0;background:var(--overlay);z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s ease;}

.fish-game-overlay.open{opacity:1;pointer-events:auto;}

.fish-game-result{width:80%;max-width:300px;background:var(--bg);border-radius:14px;padding:24px;display:flex;flex-direction:column;gap:10px;text-align:center;}

.fish-game-result-title{font-size:16px;font-weight:600;color:var(--text);}

.fish-game-result-score{font-size:44px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1.1;margin:2px 0;}

.fish-game-result-sub{font-size:12px;color:var(--text-tertiary);}

.fish-game-result-actions{display:flex;gap:24px;margin-top:12px;padding:0 12px;}

/* ===== 大鱼吃小鱼 v2 · 轮盘操作 ===== */
.fish-joystick-base{position:absolute;left:60px;bottom:80px;width:120px;height:120px;border-radius:50%;border:1.5px solid var(--accent);background:var(--accent-soft);opacity:0.35;pointer-events:none;transition:opacity .2s ease;z-index:4;visibility:hidden;}

.fish-joystick-base.active{opacity:0.75;}

.fish-joystick-stick{position:absolute;left:0;top:0;width:48px;height:48px;border-radius:50%;background:var(--accent);opacity:0;pointer-events:none;transform:translate(-50%,-50%);z-index:4;box-shadow:0 2px 14px rgba(244,162,97,.5);visibility:hidden;}

.fish-joystick-stick.active{opacity:0.9;}
.fish-combo{position:absolute;left:50%;top:26%;transform:translate(-50%,-50%) scale(.5);font-size:30px;font-weight:600;color:var(--accent);pointer-events:none;opacity:0;letter-spacing:.04em;text-shadow:0 2px 8px rgba(0,0,0,.2);transition:opacity .2s ease,transform .32s cubic-bezier(.34,1.4,.64,1);z-index:6;}

.fish-combo.show{opacity:1;transform:translate(-50%,-50%) scale(1);}

.fish-danger{position:absolute;inset:0;pointer-events:none;opacity:0;z-index:5;background:radial-gradient(ellipse at center,transparent 72%,rgba(225,90,74,0.32) 100%);transition:opacity .15s ease;}

.fish-danger.show{opacity:1;}

.fish-game-player.levelup svg{animation:fishLevelUp .5s ease-out !important;}

.fish-game-player.slowed svg{opacity:0.5;}

.fish-game-enemy svg{stroke:var(--text-secondary) !important;fill:rgba(0,0,0,0.04) !important;}

.fish-game-enemy.seahorse svg{stroke:var(--accent) !important;fill:var(--accent-soft) !important;}

.fish-game-result-stats{font-size:12.5px;color:var(--text-secondary);line-height:1.9;padding:8px 0;border-top:1px solid var(--divider);border-bottom:1px solid var(--divider);text-align:center;}

.fish-game-result-actions {
  display: flex;
  gap: 40px !important;
  margin-top: 20px !important;
  padding: 0 20px !important;
}

.fish-game-result-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity .15s ease;
}

.fish-game-result-btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.fish-game-result-btn.primary {
  background: var(--accent);
  color: #fff;
}

.fish-game-result-btn:active {
  opacity: .75;
}

/* ========== 合成大青蛙 ========== */
.frog-game-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}

.frog-game-page.open{transform:translateX(0);}

.frog-game-stage{flex:1;position:relative;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;background:var(--bg);}

.frog-game-canvas{position:absolute;inset:0;display:block;width:100%;height:100%;}

.frog-game-score{position:absolute;left:20px;top:calc(22px + var(--safe-top));font-size:22px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;pointer-events:none;z-index:5;line-height:1;}

.frog-game-best{position:absolute;right:20px;top:calc(22px + var(--safe-top));font-size:12.5px;color:var(--text-tertiary);font-variant-numeric:tabular-nums;pointer-events:none;z-index:5;letter-spacing:.02em;}

.frog-game-next{position:absolute;right:20px;top:calc(50px + var(--safe-top));width:60px;height:60px;border-radius:12px;background:var(--accent-soft);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;pointer-events:none;z-index:5;}

.frog-game-next-label{font-size:9px;color:var(--text-tertiary);line-height:1;letter-spacing:.06em;}

.frog-game-next-canvas{width:34px;height:34px;display:block;}

.frog-game-line{position:absolute;left:0;right:0;top:15%;border-top:1px dashed var(--text-tertiary);opacity:.45;pointer-events:none;z-index:4;}

.frog-game-hint{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);font-size:11.5px;color:var(--text-tertiary);pointer-events:none;letter-spacing:.02em;text-align:center;z-index:5;}

.frog-game-overlay{position:absolute;inset:0;background:var(--overlay);z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s ease;}

.frog-game-overlay.open{opacity:1;pointer-events:auto;}

.frog-game-result{width:80%;max-width:300px;background:var(--bg);border-radius:14px;padding:24px;display:flex;flex-direction:column;gap:10px;text-align:center;}

.frog-game-result-title{font-size:16px;font-weight:600;color:var(--text);}

.frog-game-result-score{font-size:44px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1.1;margin:2px 0;}

.frog-game-result-sub{font-size:12px;color:var(--text-tertiary);}

.frog-game-result-actions{display:flex;gap:24px;margin-top:12px;padding:0 12px;}

.frog-game-result-btn{flex:1;padding:12px 0;border-radius:10px;font-size:14.5px;font-weight:500;font-family:inherit;cursor:pointer;border:none;transition:opacity .15s ease;}

.frog-game-result-btn.ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);}

.frog-game-result-btn.primary{background:var(--accent);color:#fff;}

.frog-game-result-btn:active{opacity:.75;}

/* v2.21 技能栏：两行三列，横跨屏幕底部，暗格半透明不可点 */
.frog-skill-bar{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  top:100px;
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:5px;
  z-index:8;
  pointer-events:none;
  width:min(168px, 52vw);
}

.frog-skill-cell{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  aspect-ratio:1;
  border-radius:10px;
  background:var(--accent-soft);
  border:1px solid var(--border);
  opacity:0.22;
  pointer-events:none;
  padding:4px;
  transition:opacity .25s ease, background .25s ease, transform .15s ease, box-shadow .25s ease;
}

.frog-skill-cell svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:var(--text);
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
  display:block;
}

.frog-skill-name{
  font-size:9.5px;
  color:var(--text-tertiary);
  line-height:1;
  letter-spacing:.04em;
}

.frog-skill-cell.active{
  opacity:1;
  pointer-events:auto;
  cursor:pointer;
  background:var(--accent);
  border-color:var(--accent);
  box-shadow:0 0 14px var(--accent-soft);
}

.frog-skill-cell.active svg{stroke:#fff;}

.frog-skill-cell.active .frog-skill-name{color:#fff;}

.frog-skill-cell.active:active{transform:scale(.92);}

.frog-skill-cell.just-unlocked{animation:frogSkillUnlock .55s cubic-bezier(.34,1.4,.64,1);}

.frog-skill-cell.active{animation:frogSkillPulse 2.4s ease-in-out infinite;}

.frog-skill-cell.active.just-unlocked{animation:frogSkillUnlock .55s cubic-bezier(.34,1.4,.64,1);}

.frog-skill-cell.casting{animation:frogSkillConsume .3s ease-out forwards;}

/* ========== 羊了个羊 · 视觉优化版 ========== */
.sheep-game-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}

.sheep-game-page.open{transform:translateX(0);}

.sheep-stage{flex:1;position:relative;display:flex;flex-direction:column;min-height:0;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}

.sheep-info{display:flex;justify-content:space-between;align-items:baseline;padding:14px 22px 6px;flex-shrink:0;}

.sheep-score{font-size:28px;font-weight:600;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1;}

.sheep-best{font-size:13px;color:var(--text-tertiary);font-variant-numeric:tabular-nums;}

.sheep-board-wrap{flex:1;position:relative;overflow:hidden;min-height:0;padding:8px 12px;display:flex;align-items:center;justify-content:center;}

.sheep-board{position:relative;}

.sheep-card {
  position: absolute; top: 0; left: 0;
  border-radius: 8px; background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.3s ease, filter 0.3s ease, box-shadow 0.2s ease;
}

.sheep-card:not(.blocked):active {
  /* 绝不能在这里写 transform: scale(0.92) !important; 
     否则按下瞬间会覆盖 translate(var(--x), var(--y))，导致卡片瞬间回左上角、触发不了点击 */
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.sheep-card .sheep-card-inner { width: 80%; height: 80%; display: flex; align-items: center; justify-content: center; }

.sheep-card .sheep-card-inner svg { width: 100%; height: 100%; display: block; pointer-events: none; }

.sheep-card.blocked {
  opacity: 0.6;
  filter: grayscale(0.8) brightness(0.6);
  pointer-events: none;
  box-shadow: none;
  border-color: transparent;
}

.sheep-slots { display: flex; justify-content: center; gap: 6px; padding: 12px 16px calc(18px + env(safe-area-inset-bottom, 0px)); flex-shrink: 0; border-top: 1px solid var(--border); background: var(--bg); }

.sheep-slot { width: 42px; height: 42px; border-radius: 8px; background: var(--input-bg); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s ease; }

.sheep-slot.filled { background: #FFFFFF; border: 1.5px solid var(--accent); box-shadow: 0 2px 8px var(--accent-soft); }

.sheep-slot .sheep-slot-inner { width: 80%; height: 80%; display: flex; align-items: center; justify-content: center; animation: slotPop 0.3s cubic-bezier(.34,1.4,.64,1); }

.sheep-slot .sheep-slot-inner svg { width: 100%; height: 100%; display: block; }

.sheep-tool-btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--bg);
  border: 1px solid var(--border); color: var(--text-secondary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.15s ease;
}

.sheep-tool-btn:active { transform: scale(0.9); }

.sheep-overlay{position:absolute;inset:0;background:var(--overlay);z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s ease;}

.sheep-overlay.open{opacity:1;pointer-events:auto;}

.sheep-result{position:relative;width:80%;max-width:300px;background:var(--bg);border-radius:14px;padding:26px 24px;display:flex;flex-direction:column;gap:10px;text-align:center;}

.sheep-result-title{font-size:13px;color:var(--text-tertiary);letter-spacing:.12em;}

.sheep-result-score{font-size:52px;font-weight:500;color:var(--accent);font-variant-numeric:tabular-nums;line-height:1.05;margin:4px 0;}

.sheep-result-sub{font-size:12.5px;color:var(--text-tertiary);letter-spacing:.02em;}

.sheep-result-actions{display:flex;gap:10px;margin-top:10px;}

.sheep-result-btn{flex:1;padding:11px;border-radius:8px;font-size:14.5px;font-weight:500;font-family:inherit;cursor:pointer;border:none;}

.sheep-result-btn.ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);}

.sheep-result-btn.primary{background:var(--accent);color:#fff;}
/* ========== 转盘 ========== */
.wheel-game-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}

.wheel-game-page.open{transform:translateX(0);}

.wheel-body{flex:1 1 0;min-height:0;display:flex;flex-direction:column;align-items:center;padding:8px 24px 24px;gap:14px;overflow-y:auto;}

.wheel-points{text-align:center;margin-top:6px;flex-shrink:0;}

.wheel-points-label{font-size:11px;color:var(--text-tertiary);letter-spacing:.08em;}

.wheel-points-num{font-size:36px;font-weight:300;color:var(--accent);letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1.1;margin-top:2px;display:flex;align-items:center;justify-content:center;gap:8px;}

.wheel-points-num .bang-coin{width:28px;height:28px;flex-shrink:0;display:block;}

.wheel-subtitle{font-size:11.5px;color:var(--text-tertiary);letter-spacing:.06em;margin-top:4px;opacity:.85;}

.wheel-stage{position:relative;width:min(280px,72vw);height:min(280px,72vw);flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:6px;}

.wheel-pointer{position:absolute;top:-8px;left:50%;transform:translateX(-50%);width:0;height:0;border-left:9px solid transparent;border-right:9px solid transparent;border-top:16px solid var(--accent);z-index:5;filter:drop-shadow(0 2px 4px rgba(0,0,0,.18));}

.wheel-disc-wrap{position:relative;width:100%;height:100%;border-radius:50%;will-change:transform;}

.wheel-disc-inner{position:absolute;inset:0;border-radius:50%;}

.wheel-disc-inner.shake{animation:wheelShake .35s ease-out;}

.wheel-disc{position:absolute;inset:0;border-radius:50%;border:2px solid var(--border);}

.wheel-labels{position:absolute;inset:0;pointer-events:none;}

.wheel-label{position:absolute;font-size:11.5px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;white-space:nowrap;letter-spacing:.02em;line-height:1;}

.wheel-label-pos{color:var(--text);}

.wheel-label-neg{color:var(--text-tertiary);font-weight:500;}

.wheel-label-jackpot{color:#FFFFFF;font-weight:700;animation:wheelJackpot 2.5s ease-in-out infinite;}

body.dark .wheel-label-jackpot{color:#FFFFFF;}

.wheel-center{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:44px;height:44px;border-radius:50%;background:var(--bg);border:2px solid var(--border);z-index:3;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.10);}

.wheel-center::before{content:'';width:14px;height:14px;border-radius:50%;background:var(--accent);}

.wheel-spin-btn{width:100%;max-width:280px;padding:14px;border-radius:12px;background:var(--accent);color:#fff;font-size:15px;font-weight:500;font-family:inherit;border:none;cursor:pointer;letter-spacing:.04em;transition:opacity .15s ease;flex-shrink:0;}

.wheel-spin-btn:active{opacity:.8;}

.wheel-spin-btn:disabled{opacity:.45;cursor:not-allowed;background:var(--text-tertiary);}

/* .wheel-skip-btn 已废弃：抽奖时单抽/十连按钮原地变跳过 */
.wheel-spin-btn.skipping,
.wheel-multi-btn.skipping{
  background:transparent;
  color:var(--accent);
  box-shadow:inset 0 0 0 1.5px var(--accent);
}

.wheel-spin-btn.skipping:active,
.wheel-multi-btn.skipping:active{opacity:.7;}

/* 三千万预兆：转盘有节奏地发光 */
.wheel-disc-wrap.jackpot-glow{
  animation:wheelJackpotGlow 1.1s ease-in-out infinite;
}

.wheel-today{font-size:11.5px;color:var(--text-tertiary);letter-spacing:.04em;margin-top:auto;padding-top:8px;flex-shrink:0;}

.wheel-result-overlay{position:absolute;inset:0;background:var(--overlay);z-index:20;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s ease;}

.wheel-result-overlay.open{opacity:1;pointer-events:auto;}

.wheel-result{width:80%;max-width:300px;background:var(--bg);border-radius:16px;padding:26px 22px 18px;display:flex;flex-direction:column;gap:12px;align-items:center;transform:scale(.94);transition:transform .26s cubic-bezier(.22,1,.36,1);}

.wheel-result-overlay.open .wheel-result{transform:scale(1);}

.wheel-result-num{font-size:54px;font-weight:300;color:var(--accent);letter-spacing:-.03em;font-variant-numeric:tabular-nums;line-height:1;}

.wheel-result-num.neg{color:var(--text-tertiary);}

.wheel-result-num.jackpot{color:#B8963A;font-weight:400;}

.wheel-result-text{font-size:13px;color:var(--text-secondary);text-align:center;min-height:20px;line-height:1.6;}

.wheel-result-actions{display:flex;gap:10px;width:100%;margin-top:6px;}

.wheel-result-btn{flex:1;padding:12px;border-radius:10px;font-size:14.5px;font-weight:500;font-family:inherit;cursor:pointer;border:none;transition:opacity .15s ease;}

.wheel-result-btn.ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);}

.wheel-result-btn.primary{background:var(--accent);color:#fff;}

.wheel-result-btn:active{opacity:.75;}

/* ===== v2.24 转盘十连抽 ===== */
.wheel-multi-btn{
  width:100%;max-width:280px;padding:14px;border-radius:12px;
  background:var(--accent);color:#fff;
  border:none;
  font-size:15px;font-weight:500;font-family:inherit;
  cursor:pointer;letter-spacing:.04em;
  transition:opacity .15s ease;
  flex-shrink:0;
}

.wheel-multi-btn:active{opacity:.8;}

.wheel-multi-btn:disabled{opacity:.45;cursor:not-allowed;background:var(--text-tertiary);}

.wheel-multi-overlay{
  position:absolute;inset:0;background:var(--overlay);
  z-index:25;display:flex;align-items:center;justify-content:center;
  opacity:0;pointer-events:none;transition:opacity .22s ease;
}

.wheel-multi-overlay.open{opacity:1;pointer-events:auto;}

.wheel-multi-panel{
  width:92%;max-width:380px;background:var(--bg);
  border-radius:18px;padding:22px 18px 16px;
  display:flex;flex-direction:column;gap:14px;
  transform:scale(.94);transition:transform .26s cubic-bezier(.22,1,.36,1);
}

.wheel-multi-overlay.open .wheel-multi-panel{transform:scale(1);}

.wheel-multi-title{
  font-size:16px;font-weight:600;color:var(--text);
  text-align:center;letter-spacing:.04em;
}

.wheel-multi-summary{
  font-size:13px;color:var(--text-secondary);
  text-align:center;line-height:1.7;
}

.wheel-multi-summary strong{color:var(--accent);font-weight:600;}

.wheel-multi-summary .neg{color:var(--text-tertiary);}

.wheel-multi-grid{
  display:grid;grid-template-columns:repeat(5,1fr);
  grid-template-rows:repeat(2,1fr);
  gap:6px;
}

.wheel-multi-cell{
  aspect-ratio:1;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:600;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.01em;
  color:var(--text);
  position:relative;
  animation:wheelMultiCellIn .35s cubic-bezier(.34,1.4,.64,1) backwards;
}

.wheel-multi-cell.jackpot{color:#8B6914;font-weight:700;}

body.dark .wheel-multi-cell.jackpot{color:#D4B65E;}

.wheel-multi-actions{display:flex;gap:10px;margin-top:4px;}

.wheel-multi-result-btn{
  flex:1;padding:12px;border-radius:10px;
  font-size:14.5px;font-weight:500;font-family:inherit;
  cursor:pointer;border:none;transition:opacity .15s ease;
}

.wheel-multi-result-btn.ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);}

.wheel-multi-result-btn.primary{background:var(--accent);color:#fff;}

.wheel-multi-result-btn:active{opacity:.75;}

/* ===== v2.25 转盘：历史 / 三框 / 特殊结果 ===== */
.wheel-history-block{
  width:100%;max-width:280px;
  border-top:1px solid var(--divider);
  border-bottom:1px solid var(--divider);
  flex-shrink:0;
}

.wheel-history-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 2px;cursor:pointer;user-select:none;
  -webkit-user-select:none;
}

.wheel-history-total{
  font-size:12.5px;color:var(--text-secondary);
  letter-spacing:.02em;font-variant-numeric:tabular-nums;
}

.wheel-history-arrow{
  width:14px;height:14px;stroke:var(--text-tertiary);
  stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round;
  transition:transform .3s;
}

.wheel-history-block.open .wheel-history-arrow{transform:rotate(180deg);}

.wheel-history-body{
  display:grid;grid-template-rows:0fr;
  transition:grid-template-rows .35s cubic-bezier(.22,1,.36,1);
}

.wheel-history-block.open .wheel-history-body{grid-template-rows:1fr;}

.wheel-history-list{
  overflow:hidden;min-height:0;
  display:flex;flex-direction:column;
}

.wheel-history-block.open .wheel-history-list{
  max-height:44vh;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding-bottom:8px;
}

.wheel-history-row{
  display:flex;align-items:baseline;gap:8px;
  padding:8px 2px;font-size:12px;
  font-variant-numeric:tabular-nums;
  border-bottom:1px solid var(--divider);
}

.wheel-history-row:last-child{border-bottom:none;}

.wheel-history-type{
  font-size:10.5px;color:var(--text-tertiary);
  padding:1px 6px;border-radius:8px;
  background:var(--input-bg);
  flex-shrink:0;line-height:1.5;
}

.wheel-history-type.multi{background:var(--accent-soft);color:var(--accent);}

.wheel-history-time{
  font-size:11px;color:var(--text-tertiary);
  flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

.wheel-history-net{
  font-size:12px;font-weight:500;
  flex-shrink:0;
}

.wheel-history-net.pos{color:var(--accent);}

.wheel-history-net.neg{color:var(--text-tertiary);}

.wheel-history-net.jackpot{color:var(--accent);font-weight:700;letter-spacing:.06em;}

.wheel-history-empty{
  padding:20px 0;text-align:center;
  font-size:12px;color:var(--text-tertiary);
}

/* 三千万三框动画 */
.wheel-jackpot-frames{
  position:absolute;inset:0;
  z-index:30;
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  gap:14px;
  background:rgba(0,0,0,0.35);
  opacity:0;pointer-events:none;
  transition:opacity .25s ease;
}

.wheel-jackpot-frames.open{opacity:1;pointer-events:auto;}

.wheel-jackpot-frame{
  width:82%;max-width:340px;
  padding:26px 20px;
  background:var(--bg);
  border:3px solid var(--accent);
  border-radius:16px;
  box-shadow:0 8px 32px rgba(0,0,0,0.35),0 0 0 1px var(--accent-soft);
  font-size:32px;
  font-weight:600;
  color:var(--accent);
  text-align:center;
  letter-spacing:.12em;
  font-family:inherit;
  opacity:0;
  transform:translateY(-80px) scale(0.9);
  transition:opacity .4s cubic-bezier(.34,1.4,.64,1),
             transform .4s cubic-bezier(.34,1.4,.64,1);
}

.wheel-jackpot-frame.show{
  opacity:1;
  transform:translateY(0) scale(1);
}

/* 三千万特殊结果弹窗 */
.wheel-jackpot-result{
  position:absolute;inset:0;
  z-index:31;
  display:flex;align-items:center;justify-content:center;
  background:var(--overlay);
  opacity:0;pointer-events:none;
  transition:opacity .22s ease;
}

.wheel-jackpot-result.open{opacity:1;pointer-events:auto;}

.wheel-jackpot-panel{
  width:82%;max-width:340px;
  background:var(--bg);
  border-radius:18px;
  padding:28px 22px 20px;
  display:flex;flex-direction:column;gap:18px;
  align-items:center;
  transform:scale(.94);
  transition:transform .26s cubic-bezier(.22,1,.36,1);
  box-shadow:0 20px 60px rgba(0,0,0,0.28);
}

.wheel-jackpot-result.open .wheel-jackpot-panel{transform:scale(1);}

.wheel-jackpot-title{
  font-size:28px;font-weight:700;
  color:var(--accent);
  letter-spacing:.12em;
}

.wheel-jackpot-lines{
  display:flex;flex-direction:column;gap:10px;
  width:100%;
  padding:16px 14px;
  border:2px solid var(--accent);
  border-radius:12px;
  background:var(--input-bg);
  box-sizing:border-box;
}

.wheel-jackpot-lines div{
  font-size:18px;font-weight:500;
  color:var(--text);
  text-align:center;
  letter-spacing:.08em;
}

.wheel-jackpot-btn{
  width:100%;padding:14px;
  border-radius:12px;
  background:var(--accent);
  color:#FFFFFF;
  border:none;
  font-size:15px;font-weight:600;
  font-family:inherit;
  letter-spacing:.08em;
  cursor:pointer;
  transition:opacity .15s ease;
}

.wheel-jackpot-btn:active{opacity:.8;}
.sheep-card {
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.3s ease, filter 0.3s ease !important;
}

/* ============================================================
 * 狼个了狼 · 终极排版（牌堆全屏、技能栏横排、防遮挡）
 * ============================================================ */

/* 1. 页面基础结构 */
.sheep-game-page { position: absolute; inset: 0; background: var(--bg); z-index: 61; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .32s cubic-bezier(.22,1,.36,1); }

.sheep-game-page.open { transform: translateX(0); }

.sheep-stage { 
  display: flex !important; 
  flex-direction: column !important; 
  height: 100% !important; 
  overflow: hidden !important; 
  position: relative !important; 
}


/* 2. 顶部信息区 */
.sheep-info { 
  order: 1; 
  flex-shrink: 0; 
  display: flex; 
  justify-content: space-between; 
  align-items: baseline; 
  padding: 14px 22px; 
  z-index: 10; 
}


/* 3. 棋盘区域：完全撑满中间，不被遮挡 */
.sheep-board-wrap, 
#sheepBoard { 
  order: 2 !important; 
  flex: 1 !important; 
  width: 100% !important; 
  height: 100% !important; 
  position: relative !important; 
  min-height: 0 !important; 
  overflow: visible !important; 
}


/* 4. 技能栏 + 临时槽位：移到牌堆下方 */
.sheep-top-controls {
  order: 3 !important;
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  background: var(--bg) !important;
  border-top: 1px solid var(--border) !important; /* 顶部横线 */
  padding-top: 6px !important;
}


/* 技能按钮横排 */
.sheep-tools-bar {
  display: flex !important;
  justify-content: center !important;
  gap: 20px !important;
  padding: 8px 0 !important;
}


/* 5. 底部 7 个槽位 */
.sheep-slots, 
#sheepSlots {
  order: 4 !important;
  flex-shrink: 0 !important;
  display: flex !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  border-top: 1px dashed var(--divider) !important; /* 技能栏和槽位之间的虚线分割 */
  background: var(--bg) !important;
  z-index: 10 !important;
}

.sheep-slot { flex: 1; max-width: 44px; aspect-ratio: 1; border-radius: 8px; background: var(--input-bg); border: 1.5px dashed var(--border); display: flex; align-items: center; justify-content: center; }

.sheep-slot.filled { background: #FFFFFF; border: 1.5px solid var(--accent); box-shadow: 0 2px 8px var(--accent-soft); }


/* 6. 卡牌基础样式（带坐标兜底） */
.sheep-card {
  position: absolute; top: 0; left: 0;
  border-radius: 10px; background: #FFFFFF; border: 1.5px solid #D0CCC5;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--rot, 0deg)) scale(var(--card-scale, 1));
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.3s ease, filter 0.3s ease;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  z-index: 2;
}

.sheep-card-inner { width: 85%; height: 85%; display: flex; align-items: center; justify-content: center; pointer-events: none; }

.sheep-card-inner svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; }

.sheep-card.blocked { background-color: #DFDCD6; border-color: #C8C4BC; box-shadow: inset 0 4px 8px rgba(0,0,0,0.15); opacity: 1; filter: brightness(0.6); pointer-events: none; z-index: 1; }

.sheep-card.blocked .sheep-card-inner { opacity: 0.55; }

.sheep-card.is-leaving { animation: none !important; pointer-events: none !important; transition: opacity 0.15s ease, transform 0.15s ease !important; z-index: 200 !important; }

.sheep-card.shake-invalid { animation: shakeInvalid 0.3s ease-in-out; z-index: 1000; }

.sheep-card.magic-flip { animation: magicFlip 0.5s ease-in-out; z-index: 1000; }

.sheep-card.shuffling { animation: shuffleFade 0.4s ease-in-out; pointer-events: none; }

.sheep-card.just-unblocked { animation: sheep-unblock-pop 0.4s cubic-bezier(.34,1.4,.64,1) forwards; z-index: 10; }

/* ===== 修复技能4扩展槽位变成竖向排列的问题 ===== */
.sheep-temp-slots {
  display: flex !important;
  flex-direction: row !important; /* 强制横向 */
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(.22,1,.36,1) !important;
}


/* 激活时撑开高度 */
.sheep-temp-slots.active {
  height: 44px !important;
  opacity: 1 !important;
  margin-top: 2px !important;
}


/* 槽位本身的样式 */
.sheep-temp-slots .sheep-slot {
  flex: 0 0 auto !important;
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  border-radius: 8px !important;
  background: var(--accent-soft) !important;
  border: 1.5px dashed var(--accent) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}


.sheep-temp-slots .sheep-slot.filled {
  background: var(--bg) !important;
  border-style: solid !important;
  box-shadow: 0 2px 8px var(--accent-soft) !important;
}


.sheep-temp-slots .sheep-slot.shrink {
  transform: scale(0) !important;
  opacity: 0 !important;
}

.sheep-board.shake-undo {
  animation: sheepBoardShake 0.4s ease-in-out;
}


/* 飞行的幽灵卡片 */
.sheep-ghost-card {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  border-radius: 10px !important;
  background: #FFFFFF !important;
  border: 1.5px solid #D0CCC5 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.5s cubic-bezier(.34,1.2,.64,1) !important;
  transform-origin: center center !important;
}

.sheep-ghost-card svg {
  width: 85% !important;
  height: 85% !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
}

/* ============================================================
 * 狼个了狼：封印叉号 + 隐藏溢出格外框
 * ============================================================ */

/* 被封印的格子：画一个明显的 X */
.sheep-slot.is-blocked {
  position: relative !important;
  background: var(--divider) !important;
  border: 1.5px solid var(--border) !important;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.05) !important;
  opacity: 0.8 !important;
}

.sheep-slot.is-blocked::before,
.sheep-slot.is-blocked::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 15% !important;
  right: 15% !important;
  height: 2px !important;
  background: var(--text-tertiary) !important;
  border-radius: 2px !important;
  opacity: 0.6 !important;
}

.sheep-slot.is-blocked::before { transform: translateY(-50%) rotate(45deg) !important; }

.sheep-slot.is-blocked::after { transform: translateY(-50%) rotate(-45deg) !important; }


/* 隐藏溢出格（第 8 格）的外框，让牌直接飞入并消失 */
.sheep-slot.is-overflow {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sheep-card.new-deal {
  animation: dealUp 0.5s cubic-bezier(.22,1,.36,1) backwards;
  pointer-events: none; /* 动画期间防误触 */
}

/* ============================================================
 * 狼个了狼：动物主题色彩填充卡牌
 * ============================================================ */

/* 1. 正常可点击的牌：主题色底 + 深色边框 */
.sheep-card {
  /* 用 white 底色叠加半透明主题色，形成不透光的实心彩底，避免透出底下的牌 */
  background-color: #FFFFFF !important;
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft)) !important;
  border: 1.5px solid var(--accent) !important;
  color: var(--accent) !important; /* 让内部 SVG 线条颜色与边框一致并加深 */
  box-shadow: 0 4px 10px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06) !important;
  z-index: 2;
}


/* 2. 被压住的牌（blocked）：强制变灰 + 压平凹陷感 */
.sheep-card.blocked {
  background-color: #E5E5E5 !important;
  background-image: linear-gradient(rgba(220,215,210,0.88), rgba(220,215,210,0.88)) !important;
  border-color: #C0C0C0 !important;
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.15) !important;
  z-index: 1;
}


/* 被压住牌的图案进一步淡化，拉开主次视觉 */
.sheep-card.blocked .sheep-card-inner {
  opacity: 0.35 !important;
  filter: grayscale(0.8) !important;
}


/* 消除时的幽灵卡片也带上主题色，消除更爽 */
.sheep-ghost-card {
  background-color: #FFFFFF !important;
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft)) !important;
  border: 1.5px solid var(--accent) !important;
  color: var(--accent) !important;
}

/* ========== 睡眠记录 ========== */
.sleep-page{position:absolute;inset:0;background:var(--bg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);}
.sleep-page.open{transform:translateX(0);}
.sleep-body{flex:1 1 0;min-height:0;overflow-y:auto;padding:0 0 calc(40px + env(safe-area-inset-bottom,0px));}

.sleep-hero{padding:36px 24px 24px;display:flex;flex-direction:column;align-items:center;gap:18px;}
.sleep-circle-btn{width:64px;height:64px;border-radius:50%;background:var(--accent);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;box-shadow:0 4px 16px rgba(221,175,128,.35);transition:background .25s ease,box-shadow .25s ease;touch-action:none;user-select:none;-webkit-user-select:none;}
.sleep-circle-btn svg{width:32px;height:32px;stroke:#FFFFFF;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round;transition:stroke .25s ease;}
.sleep-circle-btn:active{transform:scale(.94);}
.sleep-circle-btn.active{background:var(--bg);box-shadow:inset 0 0 0 1.5px var(--accent),0 4px 16px rgba(221,175,128,.25);}
.sleep-circle-btn.active svg{stroke:var(--accent);}
.sleep-circle-btn.flipping{animation:fabFlipIn .5s cubic-bezier(.4,0,.2,1) forwards;}

.sleep-time-display{display:flex;flex-direction:column;align-items:center;gap:6px;}
.sleep-time-num{font-size:36px;font-weight:300;color:var(--accent);font-variant-numeric:tabular-nums;letter-spacing:.02em;line-height:1;}
.sleep-time-sub{font-size:12px;color:var(--text-tertiary);letter-spacing:.04em;}

.sleep-summary{padding:16px 24px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--divider);margin-top:8px;}
.sleep-summary-text{font-size:13px;color:var(--text-secondary);font-variant-numeric:tabular-nums;letter-spacing:.02em;}
.sleep-add-btn{width:26px;height:26px;border-radius:50%;border:1px solid var(--border);background:transparent;color:var(--accent);font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;flex-shrink:0;}
.sleep-add-btn:active{background:var(--accent-soft);border-color:var(--accent);}

.sleep-list{padding:0 24px;display:flex;flex-direction:column;}
.sleep-empty{padding:60px 20px;text-align:center;font-size:13px;color:var(--text-tertiary);}

/* 列表项布局 */
.sleep-item{padding:16px 0;border-bottom:1px solid var(--divider);cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:12px;}
.sleep-item-left{display:flex;align-items:flex-start;flex:1;min-width:0;}

/* 左侧参考首页的竖条：默认不可见，有梦境才亮起主题色 */
.sleep-indicator{width:3px;height:22px;border-radius:2px;background:transparent;margin-right:14px;flex-shrink:0;margin-top:4px;transition:background .2s;}
.sleep-indicator.has-note{background:var(--accent);}

.sleep-item-content{display:flex;flex-direction:column;gap:2px;min-width:0;}
.sleep-item-dur{font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:.01em;color:var(--text);}
.sleep-item-goal-txt{font-size:11.5px;color:var(--text-tertiary);font-variant-numeric:tabular-nums;letter-spacing:.02em;}
.sleep-item-right{display:flex;flex-direction:column;align-items:flex-end;gap:4px;text-align:right;}

.sleep-item-time-row{font-size:12.5px;color:var(--text-secondary);font-variant-numeric:tabular-nums;letter-spacing:.02em;display:flex;align-items:center;justify-content:flex-end;gap:4px;}
.sleep-item-moon{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--accent);}
.sleep-item-moon svg{width:100%;height:100%;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round;}

.sleep-short .sleep-item-dur{color:var(--text-tertiary);}
.sleep-normal .sleep-item-dur{color:var(--accent);}
.sleep-long .sleep-item-dur{color:#B8963A;}

/* ====== 核心修复：带 !important 的弹窗遮罩 ====== */
.sleep-modal-overlay{position:fixed !important;inset:0 !important;background:var(--overlay) !important;z-index:9999 !important;display:flex !important;align-items:center !important;justify-content:center !important;opacity:0 !important;pointer-events:none !important;transition:opacity .2s ease !important;}
.sleep-modal-overlay.open{opacity:1 !important;pointer-events:auto !important;}
.sleep-modal{width:88% !important;max-width:340px !important;background:var(--bg) !important;border-radius:16px !important;padding:18px !important;display:flex !important;flex-direction:column !important;gap:12px !important;transform:scale(.95) !important;transition:transform .2s cubic-bezier(.22,1,.36,1) !important;}
.sleep-modal-overlay.open .sleep-modal{transform:scale(1) !important;}

.sleep-modal-head{display:flex;align-items:center;justify-content:space-between;}
.sleep-modal-title{font-size:17px;font-weight:600;color:var(--text);}
.sleep-modal-close{width:32px;height:32px;border-radius:50%;border:none;background:transparent;color:var(--text-tertiary);font-size:20px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;}
.sleep-modal-body{display:flex;flex-direction:column;gap:12px;}

.sleep-modal-hint{font-size:12.5px;color:var(--text-tertiary);letter-spacing:.02em;}
.sleep-modal-timer{font-size:44px;font-weight:300;color:var(--accent);text-align:center;font-variant-numeric:tabular-nums;letter-spacing:.02em;line-height:1.1;padding:8px 0 0;}
.sleep-modal-sub{font-size:13px;color:var(--text-tertiary);text-align:center;letter-spacing:.02em;}
.sleep-modal-goal{font-size:13.5px;color:var(--text-secondary);text-align:center;font-variant-numeric:tabular-nums;letter-spacing:.02em;padding:6px 0;}

.sleep-modal-body .sleep-chip-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  margin-top: 8px;
}
.sleep-modal-body .sleep-chip {
  flex: 1;
  padding: 8px 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
  white-space: nowrap;
}
.sleep-chip.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:500;}
.sleep-chip:active{opacity:.7;}

.app-input{width:100%;background:var(--input-bg);border:none;border-radius:8px;padding:12px;font-size:14.5px;color:var(--text);font-family:inherit;outline:none;box-sizing:border-box;transition:background .2s;}
.app-input:focus{background:var(--accent-soft);}
.sleep-edit-textarea{width:100%;min-height:72px;background:var(--input-bg);border:none;border-radius:8px;padding:12px;font-size:14px;color:var(--text);font-family:inherit;outline:none;resize:none;line-height:1.6;box-sizing:border-box;transition:background .2s;}
.sleep-edit-textarea:focus{background:var(--accent-soft);}

.sleep-edit-val{width:100%;background:var(--input-bg);border-radius:8px;padding:12px;font-size:14.5px;color:var(--text);font-family:inherit;cursor:pointer;box-sizing:border-box;transition:background .2s;}
.sleep-edit-val:active{background:var(--accent-soft);}
.sleep-custom-row{margin-top:8px;}

.sleep-btn{width:100%;padding:14px;border-radius:10px;border:none;font-size:15px;font-family:inherit;font-weight:500;cursor:pointer;margin-top:8px;}
.sleep-btn.primary{background:var(--accent);color:#fff;}
.sleep-btn.primary:active{opacity:.8;}

/* ====== 核心修复：带 !important 的编辑弹窗 ====== */
.sleep-edit-overlay{position:fixed !important;inset:0 !important;background:var(--overlay) !important;z-index:9999 !important;display:flex !important;align-items:center !important;justify-content:center !important;opacity:0 !important;pointer-events:none !important;transition:opacity .2s ease !important;}
.sleep-edit-overlay.open{opacity:1 !important;pointer-events:auto !important;}
.sleep-edit-modal{width:90% !important;max-width:360px !important;max-height:88vh !important;overflow-y:auto !important;background:var(--bg) !important;border-radius:16px !important;padding:22px !important;display:flex !important;flex-direction:column !important;gap:16px !important;transform:scale(.95) !important;transition:transform .2s cubic-bezier(.22,1,.36,1) !important;}
.sleep-edit-overlay.open .sleep-edit-modal{transform:scale(1) !important;}

.sleep-edit-title{font-size:17px;font-weight:600;color:var(--text);}
.sleep-edit-body{display:flex;flex-direction:column;gap:14px;}
.sleep-edit-field{display:flex;flex-direction:column;gap:6px;}
.sleep-edit-label{font-size:12px;color:var(--text-tertiary);letter-spacing:.04em;}
.sleep-edit-duration{font-size:16px;color:var(--accent);font-variant-numeric:tabular-nums;letter-spacing:.02em;padding:4px 0;}
.sleep-edit-actions{display:flex;gap:10px;margin-top:8px;}
.sleep-edit-btn{flex:1;padding:12px;border-radius:8px;font-size:14.5px;font-weight:500;font-family:inherit;cursor:pointer;border:none;}
.sleep-edit-btn.ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);}
.sleep-edit-btn.primary{background:var(--accent);color:#fff;}
.sleep-edit-btn.danger{background:transparent;color:var(--danger);border:1px solid var(--danger);}
/* 左右对称 Tab */
.sleep-edit-tabs {
  display: flex;
  width: 100%;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
}
.sleep-edit-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.sleep-edit-tab.active {
  color: var(--accent);
  font-weight: 600;
}
.sleep-edit-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}