/* 《卡皮巴拉汤泉物语》移动端样式：竖屏优先、大触控区、抽屉面板 */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #101c1b;
  --panel: #1b2b2a;
  --panel-2: #233936;
  --water: #2f9e8f;
  --water-deep: #1f7a6e;
  --accent: #f2b544;
  --gem: #8fd3ff;
  --star: #ffd76e;
  --text: #f3ead8;
  --muted: #9db3a9;
  --danger: #e06666;
  --cell: #26403c;
  --cell-item: #e9dcc3;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

#app {
  height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: max(6px, env(safe-area-inset-top)) 8px 0;
}

button {
  font-family: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid #3a5650;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

button:active { transform: scale(0.96); }
button:disabled { opacity: 0.45; }

/* ---------- 顶栏 ---------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
}

.cur {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--panel);
  border: 1px solid #2c4641;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.cur.energy em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  margin-left: 2px;
}

.lvl {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}

.exp-track {
  flex: 1;
  height: 6px;
  background: var(--panel);
  border-radius: 3px;
  overflow: hidden;
}

#expBar {
  height: 100%;
  width: 0;
  background: var(--water);
  transition: width 0.3s;
}

.top-btn {
  position: relative;
  width: 34px;
  height: 34px;
  font-size: 16px;
  padding: 0;
  border-radius: 10px;
}

.top-btn .dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: none;
}

.top-btn.ready .dot { display: block; }

#dailyBtn.ready { border-color: var(--accent); box-shadow: 0 0 8px rgba(242, 181, 68, 0.4); }

/* ---------- 温泉场景 ---------- */

#scene {
  position: relative;
  height: 108px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #173c38 0%, #0f2a27 100%);
  border: 1px solid #2c4641;
  flex: none;
}

#pool { position: absolute; inset: 0; }

.pool-water {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 30%;
  bottom: 10%;
  border-radius: 46% 54% 52% 48% / 62% 60% 40% 38%;
  background: radial-gradient(ellipse at 40% 30%, #3fb3a2 0%, var(--water) 45%, var(--water-deep) 100%);
  opacity: 0.85;
  animation: water-wave 5s ease-in-out infinite;
}

@keyframes water-wave {
  0%, 100% { transform: scale(1) rotate(0.3deg); }
  50% { transform: scale(1.02) rotate(-0.5deg); }
}

.pool-capy { position: absolute; width: 64px; }
.capy-float-0 { left: 18%; top: 38%; animation: floaty 3.4s ease-in-out infinite; }
.capy-float-1 { left: 55%; top: 46%; animation: floaty 4.1s ease-in-out 0.7s infinite; }
.capy-float-2 { left: 38%; top: 30%; animation: floaty 3.8s ease-in-out 1.3s infinite; }
.capy-float-3 { left: 70%; top: 34%; animation: floaty 4.4s ease-in-out 0.4s infinite; }

.capy.mini { width: 64px; height: 54px; }
.capy.guest { width: 40px; height: 34px; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}

.pool-decor {
  position: absolute;
  font-size: 18px;
  opacity: 0.9;
}

.decor-0 { left: 4%; top: 12%; }
.decor-1 { right: 6%; top: 18%; }
.decor-2 { right: 14%; bottom: 8%; }

.pool-steam span {
  position: absolute;
  bottom: 22%;
  width: 10px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  filter: blur(4px);
  animation: steam 3s ease-in-out infinite;
}

.pool-steam span:nth-child(1) { left: 30%; animation-delay: 0s; }
.pool-steam span:nth-child(2) { left: 50%; animation-delay: 1s; }
.pool-steam span:nth-child(3) { left: 68%; animation-delay: 2s; }

@keyframes steam {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  40% { opacity: 0.5; }
  100% { transform: translateY(-26px) scale(1.4); opacity: 0; }
}

#areaName {
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 11px;
  color: var(--text);
  background: rgba(16, 28, 27, 0.55);
  padding: 2px 8px;
  border-radius: 999px;
}

#tipJar {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}

#tipJar.ready {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(242, 181, 68, 0.45);
  animation: tip-bounce 1.2s ease-in-out infinite;
}

@keyframes tip-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ---------- 订单 ---------- */

#orders {
  display: flex;
  gap: 6px;
  flex: none;
  min-height: 76px;
}

.order {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--panel);
  border: 1px solid #2c4641;
  border-radius: 14px;
  padding: 6px 4px;
  cursor: pointer;
  animation: order-in 0.25s ease-out;
}

@keyframes order-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.order.empty {
  color: var(--muted);
  font-size: 11px;
  cursor: default;
  animation: none;
  border-style: dashed;
}

.order.vip {
  border-color: var(--accent);
  background: linear-gradient(160deg, #2b2416 0%, var(--panel) 70%);
}

.vip-tag {
  position: absolute;
  top: -6px;
  right: -4px;
  background: var(--accent);
  color: #241a06;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  transform: rotate(6deg);
}

.order-guest { line-height: 0; }

.order-items {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}

.order-item {
  position: relative;
  font-size: 17px;
  opacity: 0.35;
  filter: grayscale(0.6);
}

.order-item.ok { opacity: 1; filter: none; }

.order-item em {
  position: absolute;
  right: -4px;
  bottom: -3px;
  font-size: 8px;
  font-style: normal;
  background: #3a5650;
  border-radius: 4px;
  padding: 0 2px;
}

.order-reward {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.order.fit { border-color: var(--water); box-shadow: 0 0 8px rgba(47, 158, 143, 0.35); }

.order-go {
  font-size: 10px;
  font-weight: 800;
  color: var(--water);
  animation: tip-bounce 2s ease-in-out infinite;
}

/* ---------- 棋盘 ---------- */

#boardWrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

#board {
  flex: 1;
  display: grid;
  gap: 4px;
  touch-action: none;
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cell);
  border-radius: 10px;
  border: 1px solid #2f4a44;
  user-select: none;
  min-height: 0;
}

.cell.has-item {
  background: var(--cell-item);
  border-color: #c9b48c;
}

.cell-icon { font-size: clamp(17px, 5.4vw, 26px); line-height: 1; }

.cell-lv {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 9px;
  font-weight: 800;
  color: #7a6537;
}

.cell.selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cell.locked {
  background: #182723;
  border-style: dashed;
  flex-direction: column;
  gap: 1px;
}

.cell-vine { font-size: 15px; opacity: 0.7; }
.cell-cost { font-size: 8px; color: var(--muted); }

.cell.fx-pop { animation: fx-pop 0.25s ease-out; }
.cell.fx-merge { animation: fx-merge 0.32s ease-out; }

@keyframes fx-pop {
  0% { transform: scale(0.3); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes fx-merge {
  0% { transform: scale(0.6) rotate(-8deg); }
  60% { transform: scale(1.25) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

#actionBar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 6px 8px;
  background: rgba(16, 28, 27, 0.94);
  border: 1px solid #3a5650;
  border-radius: 12px;
  z-index: 20;
}

#actionBar.hidden { display: none; }

.ab-info { font-size: 12px; }

.ab-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
}

.ab-sell { border-color: var(--accent); color: var(--accent); }
.ab-unlock { border-color: var(--water); color: #7fd8cb; }
.ab-close { padding: 6px 9px; }

/* ---------- 母物品栏 ---------- */

#genbar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: none;
  padding: 2px;
  scrollbar-width: none;
}

#genbar::-webkit-scrollbar { display: none; }

.gen {
  position: relative;
  flex: 1 0 70px;
  max-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 4px 5px;
  border-radius: 13px;
}

.gen-icon { font-size: 22px; }
.gen-name { font-size: 10px; color: var(--muted); white-space: nowrap; }
.gen-taps { font-size: 10px; font-weight: 800; color: var(--accent); }

.gen-rech {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: rgba(16, 28, 27, 0.7);
  border-radius: 13px;
}

.gen.dim { opacity: 0.55; }
.gen.locked { opacity: 0.5; }

/* ---------- 底部导航 ---------- */

#tabbar {
  display: flex;
  gap: 6px;
  padding: 4px 0 max(6px, env(safe-area-inset-bottom));
  flex: none;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 0 5px;
  font-size: 17px;
  border-radius: 12px;
}

.tab span { font-size: 10px; color: var(--muted); }

/* ---------- 底部抽屉面板 ---------- */

#backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 9, 0.6);
  z-index: 60;
}

#backdrop.hidden { display: none; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  max-width: 540px;
  margin: 0 auto;
  max-height: 72dvh;
  background: var(--panel);
  border: 1px solid #2c4641;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  transform: translateY(105%);
  transition: transform 0.22s ease-out;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #3a5650;
  margin: 8px auto;
}

.sheet-body {
  padding: 0 14px;
  overflow-y: auto;
  max-height: calc(72dvh - 24px);
}

.sheet-body h3 {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 6px;
}

.sheet-list { display: flex; flex-direction: column; gap: 6px; }

.sheet-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid #2f4a44;
  border-radius: 12px;
  padding: 8px 10px;
}

.sheet-row.dim { opacity: 0.55; }
.sheet-row.next-area { border-color: var(--water); }

.sr-icon { font-size: 22px; flex: none; }

.sr-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sr-main b { font-size: 13px; }
.sr-main small { font-size: 10px; color: var(--muted); }

.sr-btn {
  flex: none;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 9px;
  border-color: var(--accent);
  color: var(--accent);
}

.sr-btn.danger { border-color: var(--danger); color: var(--danger); }
.sr-btn.dim { border-color: #3a5650; color: var(--muted); }

.sheet-tip {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 12px 0 6px;
}

/* 图鉴 */

.milestone {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.ms {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 5px 2px;
}

.ms.got { color: var(--accent); border: 1px solid var(--accent); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.card-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--panel-2);
  border: 1px solid #2f4a44;
  border-radius: 12px;
  padding: 10px 4px;
}

.card-cell .cc-icon { font-size: 24px; filter: grayscale(1) opacity(0.4); }
.card-cell.owned .cc-icon { filter: none; }
.card-cell .cc-name { font-size: 9px; color: var(--muted); text-align: center; }
.card-cell.owned .cc-name { color: var(--text); }
.card-cell.owned.r-E { border-color: var(--accent); }
.card-cell.owned.r-R { border-color: var(--gem); }

.big-card { font-size: 46px; margin: 6px 0; }

/* ---------- 弹窗 / 提示 ---------- */

#modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 9, 0.65);
  padding: 24px;
}

#modal.hidden { display: none; }

.modal-box {
  width: 100%;
  max-width: 320px;
  background: var(--panel);
  border: 1px solid var(--water);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  animation: fx-pop 0.25s ease-out;
}

.modal-box h2 { font-size: 18px; margin-bottom: 10px; }
.modal-box p { font-size: 13px; color: var(--text); line-height: 1.8; margin: 8px 0; }
.modal-box .primary {
  margin-top: 12px;
  padding: 10px 30px;
  font-size: 15px;
  font-weight: 800;
  background: var(--water);
  border-color: var(--water-deep);
  border-radius: 12px;
}

#banner {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(16, 28, 27, 0.95);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 10px 22px;
  white-space: nowrap;
}

#banner.hidden { display: none; }
#banner b { font-size: 16px; }
#banner span { font-size: 12px; color: var(--accent); }
#banner.show { animation: banner-in 0.3s ease-out; }

@keyframes banner-in {
  from { transform: translateX(-50%) translateY(-30px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

#toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 96;
  background: #4a2c2c;
  color: #ffd9d9;
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  white-space: nowrap;
}

#toast.hidden { display: none; }

.float-text {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  z-index: 50;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  animation: float-up 1.4s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}

.float-text.gold { color: var(--accent); }
.float-text.gem { color: var(--gem); }
.float-text.combo { color: #ff9de2; font-size: 18px; }

#boardWrap, #scene, #orders { position: relative; }

@keyframes float-up {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-46px); }
}

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 94; }

#confetti span {
  position: absolute;
  top: 55%;
  font-size: 18px;
  animation: confetti-fly var(--dur, 1s) ease-out forwards;
}

@keyframes confetti-fly {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(260deg); opacity: 0; }
}

.drag-ghost {
  position: fixed;
  z-index: 99;
  transform: translate(-50%, -50%);
  font-size: 30px;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* ---------- 横屏与桌面微调 ---------- */

@media (min-width: 700px) and (orientation: landscape) {
  #app { max-width: 900px; }
  #boardWrap { max-width: 540px; margin: 0 auto; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   全功能版追加样式：任务/活动/商店/装扮/仓库/成就/统一面板
   ============================================================ */

/* 统一面板标题栏 */
.sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 14px 8px;
}

.sheet-title-row h2 { font-size: 16px; }

#sheetClose {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
}

/* 任务链 */
.task-card {
  background: var(--panel-2);
  border: 1px solid #2f4a44;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.task-card.done { opacity: 0.6; }

.task-head {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-prog {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
  font-weight: 800;
}

.task-desc { font-size: 10px; color: var(--muted); margin: 3px 0 8px; }
.task-stage { font-size: 12px; margin-bottom: 6px; }

.task-needs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.need-count { font-size: 10px; color: var(--muted); margin-right: 6px; }
.task-rewards { font-size: 10px; color: var(--accent); margin-bottom: 8px; }

.task-go { width: 100%; padding: 9px; }

/* 活动 */
.event-head {
  text-align: center;
  padding: 8px 0 12px;
}

.event-title { font-size: 18px; font-weight: 800; }
.event-desc { font-size: 11px; color: var(--muted); margin-top: 4px; }

.big-go {
  display: block;
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 800;
  margin: 8px 0 12px;
  border-color: var(--accent);
  color: var(--accent);
}

/* 商店货架 */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.shop-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--panel-2);
  border: 1px solid #2f4a44;
  border-radius: 12px;
  padding: 10px 6px;
}

.sc-icon { font-size: 24px; }
.sc-name { font-size: 10px; color: var(--text); text-align: center; min-height: 24px; }

/* 装扮 */
.decor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.decor-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid #2f4a44;
  border-radius: 12px;
  padding: 12px 6px;
}

.decor-cell.current { border-color: var(--water); box-shadow: 0 0 8px rgba(47, 158, 143, 0.4); }
.dc-icon { font-size: 26px; }
.dc-name { font-size: 12px; font-weight: 700; }
.dc-desc { font-size: 9px; color: var(--muted); text-align: center; }
.dc-btn.dim { font-size: 11px; color: var(--water); font-weight: 800; }

/* 仓库 */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}

.st-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cell);
  border: 1px solid #2f4a44;
  border-radius: 9px;
  position: relative;
}

.st-cell.has-item { background: var(--cell-item); border-color: #c9b48c; cursor: pointer; }

/* 更多 */
.more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px 0 16px;
}

.more-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
  font-size: 26px;
  border-radius: 14px;
}

.more-cell small { font-size: 11px; color: var(--muted); }

/* 成就进度条 */
.ach-bar {
  flex-basis: 100%;
  height: 4px;
  background: var(--cell);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.ach-bar i {
  display: block;
  height: 100%;
  background: var(--water);
}

/* 兑换码输入 */
.redeem-input {
  flex: 0 0 96px;
  background: var(--cell);
  border: 1px solid #3a5650;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 7px 8px;
  text-transform: uppercase;
  outline: none;
}

/* 水豚格子：剩余次数 + 提示 */
.cell.capy-item { border-color: #d9a05b; }

.cell-taps {
  position: absolute;
  left: 2px;
  top: 1px;
  font-size: 8px;
  font-weight: 800;
  color: #b05f17;
  background: rgba(255, 240, 210, 0.85);
  border-radius: 5px;
  padding: 0 3px;
}

/* 可合成对子提示 */
.cell.pair-hint {
  animation: pair-pulse 1.6s ease-in-out infinite;
}

@keyframes pair-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(242, 181, 68, 0); }
  50% { box-shadow: 0 0 9px rgba(242, 181, 68, 0.55); }
}

/* 操作栏存入按钮 */
.ab-store { border-color: var(--gem); color: var(--gem); }

/* 皮肤池水变色 */
.pool-water.decor-sakura { background: radial-gradient(ellipse at 40% 30%, #e8a0b4 0%, #c9708a 45%, #8f4658 100%); }
.pool-water.decor-bamboo { background: radial-gradient(ellipse at 40% 30%, #6fae7c 0%, #4a8a5c 45%, #2c5c40 100%); }
.pool-water.decor-star { background: radial-gradient(ellipse at 40% 30%, #5a6ba8 0%, #3c4a7c 45%, #232a52 100%); }
.pool-water.decor-fest { background: radial-gradient(ellipse at 40% 30%, #d9903f 0%, #b05a2c 45%, #6e2f1a 100%); }

/* ============================================================
   完善版追加：SVIP/客人台词/备份恢复/玩法说明
   ============================================================ */

/* 超级大客 */
.svip-tag {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #241a06;
}

.order.svip {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  background: linear-gradient(160deg, #33230c 0%, var(--panel) 70%);
}

/* 客人台词 */
.order-line {
  font-size: 9px;
  color: var(--muted);
  font-style: italic;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 存档码输入输出 */
.backup-text {
  width: 100%;
  min-height: 88px;
  margin: 8px 0;
  padding: 8px;
  background: var(--cell);
  border: 1px solid #3a5650;
  border-radius: 10px;
  color: var(--text);
  font-size: 10px;
  font-family: ui-monospace, monospace;
  resize: none;
  outline: none;
  word-break: break-all;
}

.modal-box .btn-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.modal-box .btn-row .primary {
  margin-top: 0;
}

.modal-box .primary.danger {
  background: var(--danger);
  border-color: #b04a4a;
}

/* 玩法说明 */
.howto {
  text-align: left;
  font-size: 12px;
  line-height: 1.9;
  color: var(--text);
}

.howto p { margin: 4px 0; }
.howto b { color: var(--accent); }

/* ============================================================
   美术升级 v2：场景分层 / 泡水水豚 / 家族配色 / 等级框
   ============================================================ */

/* ---------- 场景 v2：石边 + 木台 + 涟漪 + 泡水水豚 ---------- */

#scene {
  border: 1px solid #3a5248;
}

.pool-rim {
  position: absolute;
  left: 4.5%;
  right: 4.5%;
  top: 26%;
  bottom: 6%;
  border-radius: 46% 54% 52% 48% / 62% 60% 40% 38%;
  border: 7px solid #5a4a3a;
  box-shadow: inset 0 0 0 2px #3a2f24, 0 3px 8px rgba(0, 0, 0, 0.4);
}

.pool-rock {
  position: absolute;
  width: 20px;
  height: 16px;
  background: linear-gradient(145deg, #7a6a5c, #4a3f34);
  border-radius: 45% 55% 50% 50%;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.2);
}

.pool-rock.rock-0 { left: 12%; top: 22%; transform: rotate(-12deg); }
.pool-rock.rock-1 { right: 14%; top: 24%; transform: rotate(9deg) scale(0.9); }
.pool-rock.rock-2 { left: 8%; bottom: 6%; transform: rotate(6deg) scale(1.1); }
.pool-rock.rock-3 { right: 9%; bottom: 5%; transform: rotate(-7deg) scale(0.85); }

.pool-deck {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 9px;
  background: repeating-linear-gradient(90deg, #6b5138 0 18px, #5a442e 18px 20px);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.35);
}

.pool-water {
  left: 8%;
  right: 8%;
  top: 32%;
  bottom: 11%;
  animation: water-wave 8s ease-in-out infinite;
}

@keyframes water-wave {
  0%, 100% { transform: scale(1) rotate(0.2deg); }
  50% { transform: scale(1.012) rotate(-0.3deg); }
}

/* 涟漪 */
.pool-ripples span {
  position: absolute;
  left: 50%;
  top: 52%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  animation: ripple 4s ease-out infinite;
}

.pool-ripples span:nth-child(1) { animation-delay: 0s; }
.pool-ripples span:nth-child(2) { left: 32%; animation-delay: 1.3s; }
.pool-ripples span:nth-child(3) { left: 66%; animation-delay: 2.6s; }

@keyframes ripple {
  0% { width: 8px; height: 4px; margin: -2px 0 0 -4px; opacity: 0.7; }
  100% { width: 90px; height: 34px; margin: -17px 0 0 -45px; opacity: 0; }
}

/* 泡水水豚：下半截被水面盖住 */
.pool-capy {
  position: absolute;
  width: 72px;
  height: 58px;
  overflow: hidden;
  border-radius: 8px;
}

.pool-capy .capy-body {
  position: absolute;
  left: 0;
  top: 0;
}

.capy-waterline {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -2px;
  height: 26px;
  border-radius: 48% 52% 0 0 / 30% 30% 0 0;
  background: linear-gradient(180deg, rgba(63, 179, 162, 0.72), rgba(31, 122, 110, 0.92));
}

.capy-waterline.decor-sakura { background: linear-gradient(180deg, rgba(232, 160, 180, 0.72), rgba(143, 70, 88, 0.92)); }
.capy-waterline.decor-bamboo { background: linear-gradient(180deg, rgba(111, 174, 124, 0.72), rgba(44, 92, 64, 0.92)); }
.capy-waterline.decor-star { background: linear-gradient(180deg, rgba(90, 107, 168, 0.72), rgba(35, 42, 82, 0.92)); }
.capy-waterline.decor-fest { background: linear-gradient(180deg, rgba(217, 144, 63, 0.72), rgba(110, 47, 26, 0.92)); }
.capy-waterline.decor-beach { background: linear-gradient(180deg, rgba(125, 211, 252, 0.72), rgba(30, 100, 150, 0.92)); }

.pool-water.decor-beach { background: radial-gradient(ellipse at 40% 30%, #7dd3fc 0%, #38a8dd 45%, #1e6496 100%); }

/* ---------- 物品家族配色 + 等级框 ---------- */

.cell.has-item[data-chain="towel"] { background: linear-gradient(145deg, #e3edf9, #c9daf1); border-color: #93b4e0; }
.cell.has-item[data-chain="bath"] { background: linear-gradient(145deg, #d9f3ee, #bde8e0); border-color: #6ec9bc; }
.cell.has-item[data-chain="duck"] { background: linear-gradient(145deg, #fdf3d0, #f8e6a8); border-color: #e0bd5a; }
.cell.has-item[data-chain="snack"] { background: linear-gradient(145deg, #fdeadd, #f5d5bd); border-color: #dfa273; }
.cell.has-item[data-chain="candle"] { background: linear-gradient(145deg, #eadff7, #d8c8ef); border-color: #a98de0; }
.cell.has-item[data-chain="capy"] { background: linear-gradient(145deg, #efe3d0, #e0cba8); border-color: #c99b60; }
.cell.has-item[data-chain="beach"] { background: linear-gradient(145deg, #dff2fd, #c0e4f8); border-color: #6fbde8; }
.cell.has-item[data-chain="cake"] { background: linear-gradient(145deg, #fde4ef, #f8c9de); border-color: #e58ab8; }

/* 等级框：银 → 金 → 炫彩 */
.cell.lv-mid {
  box-shadow: inset 0 0 0 2px rgba(226, 232, 240, 0.75), 0 0 4px rgba(203, 213, 225, 0.4);
}

.cell.lv-high {
  box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.6), 0 0 8px rgba(251, 191, 36, 0.5);
}

.cell.lv-max {
  position: relative;
  animation: max-frame 2.4s linear infinite;
}

.cell.lv-max::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: shine-sweep 2.4s linear infinite;
  pointer-events: none;
}

@keyframes max-frame {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.8), 0 0 10px rgba(251, 191, 36, 0.6); }
  50% { box-shadow: inset 0 0 0 2px rgba(232, 121, 249, 0.8), 0 0 12px rgba(232, 121, 249, 0.55); }
}

@keyframes shine-sweep {
  0% { background-position: 120% 0; }
  100% { background-position: -130% 0; }
}

/* 可合成提示：更柔和 */
.cell.pair-hint {
  animation: pair-pulse 2.8s ease-in-out infinite;
}

@keyframes pair-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(242, 181, 68, 0); }
  50% { box-shadow: 0 0 7px rgba(242, 181, 68, 0.35); }
}

/* ---------- 图鉴造型卡 ---------- */

.card-cell .cc-capy {
  width: 56px;
  height: 45px;
}

.card-cell .cc-capy.unknown {
  filter: grayscale(1) brightness(0.5) opacity(0.45);
}

.capy.big { width: 90px; height: 72px; }
.capy.card { width: 56px; height: 45px; }

/* 订单客人台词防溢出微调 */
.order-guest { width: 46px; height: 38px; overflow: hidden; }
.capy.guest { width: 46px; height: 38px; }

/* ============================================================
   布局瘦身：外围压缩，棋盘格恢复正方形
   ============================================================ */

#app { gap: 5px; padding-top: max(4px, env(safe-area-inset-top)); }

/* 顶栏瘦身 */
#topbar { min-height: 32px; gap: 3px; }
.cur { padding: 3px 6px; font-size: 11px; }
.cur.energy em { font-size: 9px; }
.lvl { font-size: 10px; }
.top-btn { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }

/* 场景压缩 */
#scene { height: 76px; }
.pool-capy { width: 56px; height: 46px; }
.pool-capy .capy-body svg.capy.mini { width: 56px; height: 45px; }

/* 订单压缩 */
#orders { min-height: 60px; gap: 4px; }
.order { padding: 4px 3px; gap: 2px; border-radius: 12px; min-width: 0; overflow: hidden; }
.order-reward { white-space: nowrap; }
.order-guest { width: 38px; height: 31px; }
.capy.guest { width: 38px; height: 31px; }
.order-line { font-size: 8px; }
.order-item { font-size: 15px; }
.order-reward { font-size: 9px; }
.order-go { font-size: 9px; }
.order.empty { font-size: 9px; }
.vip-tag { font-size: 8px; padding: 0 5px; }

/* 母物品栏压缩 */
#genbar { gap: 4px; padding: 1px; }
.gen { flex-basis: 60px; max-width: 78px; padding: 4px 2px 3px; border-radius: 10px; }
.gen-icon { font-size: 17px; }
.gen-name { font-size: 9px; }
.gen-taps { font-size: 9px; }

/* 底部导航压缩 */
#tabbar { gap: 4px; padding: 2px 0 max(4px, env(safe-area-inset-bottom)); }
.tab { padding: 4px 0 3px; font-size: 14px; }
.tab span { font-size: 9px; }

/* 棋盘格：正方形 + 居中，绝不再压扁 */
#board { align-content: center; }
.cell { aspect-ratio: 1 / 1; }
#boardWrap { overflow: hidden; }

/* 小屏再压一档 */
@media (max-width: 420px) {
  #scene { height: 66px; }
  .pool-capy { width: 48px; height: 40px; }
  .lvl { display: none; }
  .order-line { display: none; }
  #orders { min-height: 54px; }
}
