/* cat-games / lib / style.css —— 圆滚滚 Q 版小猫 · 治愈系粉橙主题 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #3a3340;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}

#app {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  /* 治愈系粉橙渐变 + 柔光斑点 */
  background:
    radial-gradient(circle at 14% 12%, rgba(255,176,200,.40), transparent 40%),
    radial-gradient(circle at 86% 16%, rgba(150,190,255,.34), transparent 42%),
    radial-gradient(circle at 50% 96%, rgba(255,206,150,.42), transparent 46%),
    linear-gradient(160deg, #fff5ee 0%, #ffe9f3 52%, #eaf1ff 100%);
}

#game {
  background: #fef6ee;
  border-radius: 20px;
  box-shadow: 0 14px 44px rgba(80,50,90,.4);
  touch-action: none;
}
#game.hidden { display: none; }

.screen {
  position: absolute;
  width: min(520px, 100%);
  height: 100%;
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  padding: 18px 16px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.screen.hidden { display: none; }

/* ---------- 首页 ---------- */
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.hub-logo {
  font-size: 19px; font-weight: 800; color: #fff; letter-spacing: .5px;
  background: linear-gradient(145deg, #ffb05a, #ff8f3c);
  padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(255,143,60,.42);
}
.hub-stat {
  font-size: 12px; background: #fff; padding: 6px 12px; border-radius: 999px;
  color: #c46a2c; font-weight: 700; box-shadow: 0 3px 8px rgba(120,90,120,.12);
}
.hub-tip { font-size: 13px; color: #9a8597; margin: 14px 4px 16px; }

.hub-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.game-card {
  border: none; cursor: pointer; text-align: left; position: relative; overflow: hidden;
  background: #fff; border-radius: 20px; padding: 14px 12px 13px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 8px 20px rgba(120,90,120,.15);
  border-bottom: 5px solid var(--accent, #F6A24B);
  transition: transform .14s ease, box-shadow .14s ease;
  animation: cardIn .42s cubic-bezier(.2,.8,.3,1) both;
}
.game-card:nth-child(1){animation-delay:.03s} .game-card:nth-child(2){animation-delay:.07s}
.game-card:nth-child(3){animation-delay:.11s} .game-card:nth-child(4){animation-delay:.15s}
.game-card:nth-child(5){animation-delay:.19s} .game-card:nth-child(6){animation-delay:.23s}
.game-card:nth-child(7){animation-delay:.27s} .game-card:nth-child(8){animation-delay:.31s}
.game-card::before {
  content: ''; position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--accent, #F6A24B); opacity: .14; filter: blur(7px);
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(120,90,120,.22); }
.game-card:active { transform: translateY(-1px) scale(.97); }
.card-icon { width: 90px; height: 90px; position: relative; z-index: 1; }
.card-meta { width: 100%; text-align: center; position: relative; z-index: 1; }
.card-title { font-weight: 800; font-size: 15px; color: #3a3340; }
.card-sub { font-size: 11px; color: #b09bb0; margin-top: 1px; }
.card-prog {
  display: inline-block; font-size: 11px; font-weight: 800; color: #fff;
  background: var(--accent, #F6A24B); padding: 2px 11px; border-radius: 999px; margin-top: 6px;
}
.hub-foot { margin-top: auto; padding: 16px 0 4px; text-align: center; font-size: 12px; color: #b3a3b3; }

/* ---------- 关卡选择 ---------- */
.lv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.back {
  border: none; background: #fff; border-radius: 12px; padding: 9px 14px; font-size: 15px;
  cursor: pointer; box-shadow: 0 3px 8px rgba(120,90,120,.14); color: #6a5a68; font-weight: 700;
  transition: transform .1s ease;
}
.back:active { transform: scale(.95); }
.lv-title { font-size: 19px; font-weight: 800; color: #e0813a; }
.lv-sub { font-size: 12px; color: #9a8597; margin-top: 1px; }
.level-list { display: flex; flex-direction: column; gap: 11px; }
.level-btn {
  display: flex; align-items: center; gap: 14px;
  border: none; cursor: pointer; background: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(120,90,120,.13); text-align: left;
  border-left: 5px solid #ffb070;
  transition: transform .12s ease, box-shadow .12s ease;
}
.level-btn:hover { transform: translateX(3px); box-shadow: 0 8px 18px rgba(120,90,120,.2); }
.level-btn:active { transform: scale(.98); }
.level-btn.locked { opacity: .55; filter: grayscale(.45); }
.level-btn.locked .lv-name::before { content: '🔒 '; }
.lv-num {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(145deg, #ffd28a, #ff9f45); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(255,159,69,.4);
}
.level-btn.locked .lv-num { background: linear-gradient(145deg, #cfcfd6, #a9a9b3); box-shadow: none; }
.lv-name { flex: 1; font-size: 15px; font-weight: 700; color: #3a3340; }
.lv-stars { color: #ffb400; font-size: 16px; letter-spacing: 2px; }

/* ---------- 结算 ---------- */
#result { align-items: center; justify-content: center; }
.result-box {
  background: #fff; border-radius: 26px; padding: 30px 26px; width: 88%; max-width: 360px; text-align: center;
  box-shadow: 0 18px 50px rgba(120,90,120,.28);
  border-bottom: 6px solid #F6A24B;
  position: relative; overflow: hidden;
  animation: pop .38s cubic-bezier(.2,.9,.3,1.35);
}
.result-title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.result-title.win { color: #46c06c; }
.result-title.lose { color: #e07e7e; }
.result-stars { font-size: 44px; color: #ffb400; letter-spacing: 8px; margin: 8px 0; animation: starPop .5s ease; }
.result-msg { font-size: 14px; color: #9a8597; margin-bottom: 22px; }
.result-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  border: none; border-radius: 14px; padding: 12px 22px; font-size: 15px; font-weight: 800; cursor: pointer;
  background: #ffe6cc; color: #c46a2c; box-shadow: 0 4px 12px rgba(196,106,44,.18);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:active { transform: scale(.95); }
.btn.primary { background: linear-gradient(145deg, #ffb05a, #ff8f3c); color: #fff; box-shadow: 0 7px 18px rgba(255,143,60,.42); }
.btn.ghost { background: #f1edf2; color: #8a7a88; box-shadow: none; }
.hidden { display: none; }

/* ---------- 难度/模式选择（人机对战类） ---------- */
.sel-title { font-size: 15px; font-weight: 800; color: #e0813a; margin: 16px 4px 9px; }
.diff-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.diff-btn {
  border: none; cursor: pointer; background: #fff; border-radius: 14px; padding: 13px 2px;
  font-size: 13px; font-weight: 700; color: #8a7a88; box-shadow: 0 3px 10px rgba(120,90,120,.12);
  transition: all .12s ease;
}
.diff-btn:active { transform: scale(.95); }
.diff-btn.on { background: linear-gradient(145deg, #ffb05a, #ff8f3c); color: #fff; box-shadow: 0 6px 16px rgba(255,143,60,.45); transform: translateY(-1px); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-btn {
  border: none; cursor: pointer; background: #fff; border-radius: 14px; padding: 14px;
  font-size: 15px; font-weight: 700; color: #8a7a88; box-shadow: 0 3px 10px rgba(120,90,120,.12);
  transition: all .12s ease;
}
.mode-btn:active { transform: scale(.96); }
.mode-btn.on { background: linear-gradient(145deg, #7fd0ef, #54b6e0); color: #fff; box-shadow: 0 6px 16px rgba(84,182,224,.4); transform: translateY(-1px); }
.diff-start { margin-top: 24px; font-size: 18px; padding: 15px; width: 100%; }

@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes starPop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
