/* 湘学乐园 · 儿童游戏 UI 主题 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(180deg, #7cc4ff 0%, #b8e4ff 45%, #eaf9ff 100%);
  overflow: hidden; user-select: none; -webkit-user-select: none; color: #2d3436;
  transition: background .4s;
}
body[data-theme="math"]    { background: linear-gradient(180deg, #34447e 0%, #5b74b8 60%, #8fa8dd 100%); }
body[data-theme="chinese"] { background: linear-gradient(180deg, #7ed6a5 0%, #b8ead0 55%, #e7f9ee 100%); }
body[data-theme="english"] { background: linear-gradient(180deg, #3fb6e8 0%, #7fd8f7 55%, #e0f7ff 100%); }
body[data-theme="ency"]    { background: linear-gradient(180deg, #67b26f 0%, #a3d977 55%, #eef9d9 100%); }
#app { position: fixed; inset: 0; }
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 800; color: #3a3a5c; line-height: 1.6; }

/* ---------- 背景漂浮装饰 ---------- */
.deco { position: fixed; z-index: 0; opacity: .45; font-size: 30px; pointer-events: none;
  animation: floaty 7s ease-in-out infinite alternate; }

/* ---------- 屏幕容器 ---------- */
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding: 0 14px calc(26px + env(safe-area-inset-bottom)); animation: screenIn .35s ease; z-index: 1; }
.screen::-webkit-scrollbar { width: 0; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 2px; background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,0)); }
.icon-btn { width: 46px; height: 46px; flex: none; border-radius: 50%; border: none; background: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.12); font-size: 20px; cursor: pointer; transition: transform .08s; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.top-title { flex: 1; font-size: 21px; font-weight: 900; color: #3a3a5c; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-chip { background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 900;
  color: #f5a623; box-shadow: 0 4px 0 rgba(0,0,0,.1); font-size: 16px; white-space: nowrap; }

/* ---------- 通用按钮/卡片 ---------- */
.btn { border: none; border-radius: 18px; padding: 14px 22px; font-size: 18px; font-weight: 900;
  cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.15); transition: transform .08s; font-family: inherit; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.btn.primary { background: linear-gradient(180deg, #ffb347, #ff8c42); color: #fff; }
.btn.green { background: linear-gradient(180deg, #5ff0b0, #10c98a); color: #fff; }
.btn.blue { background: linear-gradient(180deg, #74b9ff, #0984e3); color: #fff; }
.btn.ghost { background: #fff; color: #636e88; box-shadow: 0 5px 0 rgba(0,0,0,.08); }
.btn.big { font-size: 20px; padding: 16px 30px; border-radius: 22px; }
.card { background: #fff; border-radius: 24px; padding: 20px; box-shadow: 0 6px 0 rgba(0,0,0,.08); }

/* ---------- 首页 ---------- */
.home-head { text-align: center; padding: 24px 0 6px; position: relative; }
.logo { font-size: 42px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(90deg, #ff6b6b, #feca57, #1dd1a1, #48dbfb, #a55eea);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(255,255,255,.9)); }
.motto { color: #5a6b8c; margin-top: 4px; font-weight: 700; }
.profile-chip { display: inline-flex; gap: 14px; align-items: center; background: #fff; border-radius: 999px;
  padding: 8px 20px; margin-top: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.08); font-weight: 800; color: #3a3a5c; }
.profile-chip .star { color: #f5a623; }
.grade-row { display: flex; gap: 14px; overflow-x: auto; padding: 20px 4px 14px; scroll-snap-type: x mandatory; }
.grade-row::-webkit-scrollbar { height: 0; }
.grade-card { scroll-snap-align: center; min-width: 152px; flex: 1; border-radius: 26px; padding: 24px 12px 16px;
  text-align: center; color: #fff; cursor: pointer; box-shadow: 0 8px 0 rgba(0,0,0,.14);
  position: relative; transition: transform .12s; }
.grade-card:active { transform: scale(.95); }
.grade-card .g-emoji { font-size: 46px; display: block; filter: drop-shadow(0 3px 2px rgba(0,0,0,.15)); }
.grade-card .g-name { font-size: 20px; font-weight: 900; margin-top: 8px; text-shadow: 0 2px 2px rgba(0,0,0,.15); }
.grade-card .g-sub { font-size: 12px; opacity: .92; margin-top: 4px; font-weight: 700; }
.grade-card.locked { filter: grayscale(.95); opacity: .78; }
.g2 { background: linear-gradient(180deg, #ffd36b, #ffab4a); }
.g3 { background: linear-gradient(180deg, #6ee7a0, #21b573); }
.g4 { background: linear-gradient(180deg, #6fc3ff, #2d8fe0); }
.g5 { background: linear-gradient(180deg, #c79bff, #8e5cf0); }
.g6 { background: linear-gradient(180deg, #ff8f9f, #e8485e); }
.lock-badge { position: absolute; top: 10px; right: 12px; font-size: 20px; }
.home-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.menu-btn { background: #fff; border-radius: 22px; padding: 16px 6px; text-align: center; font-weight: 900;
  color: #3a3a5c; box-shadow: 0 5px 0 rgba(0,0,0,.08); cursor: pointer; font-size: 15px; transition: transform .1s; }
.menu-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.menu-btn .m-emoji { font-size: 32px; display: block; margin-bottom: 6px; }
.home-tip { text-align: center; color: #7a8aa8; font-size: 12px; margin-top: 16px; font-weight: 600; }

/* ---------- 学科选择 ---------- */
.subject-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px 2px; max-width: 640px; margin: 0 auto; }
.subject-card { border-radius: 28px; padding: 28px 10px 18px; text-align: center; color: #fff; cursor: pointer;
  box-shadow: 0 8px 0 rgba(0,0,0,.14); position: relative; overflow: hidden; transition: transform .12s; }
.subject-card:active { transform: scale(.96); }
.subject-card .s-emoji { font-size: 54px; display: block; filter: drop-shadow(0 4px 2px rgba(0,0,0,.15)); }
.subject-card .s-name { font-size: 22px; font-weight: 900; margin-top: 10px; text-shadow: 0 2px 2px rgba(0,0,0,.15); }
.subject-card .s-sub { font-size: 12px; opacity: .95; font-weight: 700; margin-top: 3px; }
.s-bar { height: 12px; background: rgba(255,255,255,.35); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.s-bar i { display: block; height: 100%; background: #fff; border-radius: 999px; transition: width .4s; }
.s-chinese { background: linear-gradient(180deg, #4cd97b, #1da75f); }
.s-math    { background: linear-gradient(180deg, #6ab8ff, #1f74d8); }
.s-english { background: linear-gradient(180deg, #ffc46b, #f08a2d); }
.s-ency    { background: linear-gradient(180deg, #b78af5, #7d3fe0); }

/* ---------- 关卡地图 ---------- */
.map-wrap { max-width: 460px; margin: 6px auto 0; position: relative; padding: 8px 0 46px; }
.map-path { position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; transform: translateX(-50%);
  background-image: linear-gradient(180deg, rgba(255,255,255,.95) 62%, transparent 0);
  background-size: 6px 28px; border-radius: 3px; opacity: .8; }
.map-node { position: relative; z-index: 2; width: 84px; height: 84px; margin: 26px auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 38px; background: #fff;
  box-shadow: 0 7px 0 rgba(0,0,0,.14); cursor: pointer; border: 5px solid #dfe6f2; transition: transform .1s; }
.map-node:active { transform: scale(.93); }
.map-node.alt { margin-left: calc(50% - 42px + 88px); }
.map-node:not(.alt) { margin-left: calc(50% - 42px - 88px); }
.map-node.done { border-color: #ffd166; }
.map-node.current { border-color: #ff6b6b; animation: pulse 1.3s infinite; }
.map-node.locked { filter: grayscale(1); opacity: .62; cursor: default; }
.node-stars { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  font-size: 13px; white-space: nowrap; color: #f5a623; text-shadow: 0 1px 0 #fff; letter-spacing: 1px; }
.node-label { position: absolute; top: 88px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: rgba(255,255,255,.95); padding: 4px 12px; border-radius: 10px; font-size: 12px;
  font-weight: 800; color: #3a3a5c; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.map-head { text-align: center; color: #3a3a5c; padding-top: 4px; }
.map-head .mh-sub { font-size: 13px; color: #667; font-weight: 700; margin-top: 4px; }

/* ---------- 游戏页 ---------- */
.play-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 2px; background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,0)); }
.progress { flex: 1; height: 16px; background: rgba(255,255,255,.75); border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(0,0,0,.08); }
.progress i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #1dd1a1, #48dbfb); transition: width .35s; }
.play-count { font-weight: 900; color: #3a3a5c; font-size: 15px; white-space: nowrap; }
.play-stage { max-width: 640px; margin: 0 auto; }
.q-card { background: #fff; border-radius: 26px; padding: 22px 20px; text-align: center;
  box-shadow: 0 7px 0 rgba(0,0,0,.1); margin: 12px auto; }
.q-text { font-size: clamp(22px, 6vw, 32px); font-weight: 900; color: #2d3436; line-height: 1.35; }
.q-text .blank { color: #e8485e; letter-spacing: 2px; }
.q-sub { color: #8a93a6; margin-top: 8px; font-size: 15px; font-weight: 700; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; margin: 14px auto 0; }
.opts.one { grid-template-columns: 1fr; }
.opt { background: #fff; border: none; border-radius: 22px; padding: 20px 10px; font-size: clamp(18px, 5vw, 26px);
  font-weight: 900; color: #3a3a5c; box-shadow: 0 6px 0 rgba(0,0,0,.13); cursor: pointer;
  font-family: inherit; transition: transform .1s; line-height: 1.3; }
.opt:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.13); }
.opt.good { background: linear-gradient(180deg, #5ff0b0, #10c98a); color: #fff; animation: pop .3s; }
.opt.bad { background: linear-gradient(180deg, #ff8f9f, #e8485e); color: #fff; animation: shake .35s; }
.opt:disabled { cursor: default; }
.feedback { text-align: center; min-height: 40px; margin-top: 14px; font-size: 22px; font-weight: 900; }
.feedback.good { color: #10c98a; }
.feedback.bad { color: #e8485e; }

/* 打地鼠 */
.mole-field { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 560px; margin: 10px auto 0; }
.hole { position: relative; height: 118px; overflow: hidden; border-radius: 0 0 22px 22px; }
.hole::after { content: ''; position: absolute; bottom: 0; left: 6%; width: 88%; height: 30px;
  background: rgba(93, 58, 26, .9); border-radius: 50%; z-index: 3; box-shadow: inset 0 6px 8px rgba(0,0,0,.35); }
.mole { position: absolute; left: 50%; bottom: 6px; width: 76%; height: 96px; z-index: 2;
  transform: translate(-50%, 115%); transition: transform .16s ease-out;
  background: linear-gradient(180deg, #c98d5e, #8d5a2f); border-radius: 46% 46% 18% 18%;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900;
  font-size: clamp(16px, 4.6vw, 22px); text-shadow: 0 1px 2px rgba(0,0,0,.3); cursor: pointer; }
.mole::before { content: '🐹'; position: absolute; top: 2px; font-size: 18px; }
.mole.up { transform: translate(-50%, 12%); }
.mole.good { background: linear-gradient(180deg, #5ff0b0, #10c98a); }
.mole.bad { background: linear-gradient(180deg, #ff8f9f, #e8485e); }

/* 打气球 */
.balloon-field { position: relative; height: 400px; max-width: 600px; margin: 6px auto 0; overflow: hidden;
  border-radius: 26px; background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,.65)); }
.balloon { position: absolute; bottom: -150px; width: 96px; height: 118px; z-index: 2;
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%; color: #fff; font-weight: 900;
  font-size: clamp(15px, 4.6vw, 22px); display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.2);
  box-shadow: inset -10px -12px 0 rgba(0,0,0,.08); animation: rise linear forwards; }
.balloon::after { content: ''; position: absolute; top: 100%; left: 50%; width: 2px; height: 56px;
  background: rgba(255,255,255,.75); }
.balloon.good { background: linear-gradient(180deg, #5ff0b0, #10c98a) !important; }
.balloon.pop { animation: pop .28s forwards; }

/* 敲恐龙蛋 */
.egg-field { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 540px; margin: 14px auto 0; }
.egg { height: 118px; background: linear-gradient(180deg, #fffdf5, #ffe9c2); border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  display: flex; align-items: center; justify-content: center; font-size: clamp(16px, 4.6vw, 22px);
  font-weight: 900; color: #6d4c41; cursor: pointer; box-shadow: 0 7px 0 rgba(0,0,0,.12);
  position: relative; transition: transform .1s; text-align: center; padding: 6px; }
.egg::before { content: '🥚'; position: absolute; top: 6px; font-size: 14px; opacity: .6; }
.egg:active { transform: scale(.94); }
.egg.good { background: linear-gradient(180deg, #baf7d6, #35d68f); color: #fff; }
.egg.bad { background: linear-gradient(180deg, #ffc4cd, #f3697e); color: #fff; animation: shake .35s; }

/* 打飞碟 */
.ufo-field { position: relative; height: 230px; max-width: 640px; margin: 8px auto 0; overflow: hidden;
  border-radius: 26px; background: linear-gradient(180deg, #2b3a67, #4a5da8); }
.ufo { position: absolute; width: 128px; height: 84px; cursor: pointer; animation: ufoSway linear infinite alternate; }
.ufo .dome { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 62px; height: 44px;
  background: rgba(214, 245, 255, .95); border-radius: 50% 50% 10px 10px; }
.ufo .body { position: absolute; left: 0; right: 0; bottom: 8px; height: 36px;
  background: linear-gradient(180deg, #b8e7ff, #48a8e8); border-radius: 50%;
  box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.ufo .label { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2; text-align: center;
  color: #14335c; font-weight: 900; font-size: clamp(14px, 4.4vw, 19px); }
.ufo.good .body { background: linear-gradient(180deg, #5ff0b0, #10c98a); }
.ufo.bad .body { background: linear-gradient(180deg, #ff8f9f, #e8485e); }
.ufo.dropping { animation: ufoDrop .6s forwards; }

/* ---------- 翻牌配对 ---------- */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 560px; margin: 14px auto; }
.mem-card { aspect-ratio: 3 / 4; perspective: 700px; cursor: pointer; }
.mem-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .35s; }
.mem-card.flip .mem-inner { transform: rotateY(180deg); }
.mem-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 900;
  font-size: clamp(14px, 4.2vw, 21px); padding: 6px; text-align: center; }
.mem-front { background: linear-gradient(160deg, #a29bfe, #6c5ce7); color: #fff; font-size: 34px;
  box-shadow: 0 5px 0 rgba(0,0,0,.14); }
.mem-back { background: #fff; transform: rotateY(180deg); color: #3a3a5c; box-shadow: 0 5px 0 rgba(0,0,0,.12);
  line-height: 1.25; word-break: break-all; }
.mem-card.matched .mem-back { background: #d9f7e8; outline: 3px solid #10c98a; }
.mem-card.bad .mem-back { background: #ffe3e3; outline: 3px solid #e8485e; }

/* ---------- 连线 ---------- */
.link-cols { display: flex; justify-content: space-between; gap: 12px; max-width: 640px; margin: 14px auto; }
.link-col { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.link-item { background: #fff; border-radius: 18px; padding: 14px 8px; text-align: center; font-weight: 900;
  font-size: clamp(16px, 4.4vw, 21px); color: #3a3a5c; box-shadow: 0 5px 0 rgba(0,0,0,.11); cursor: pointer;
  min-height: 66px; display: flex; align-items: center; justify-content: center; transition: transform .1s; line-height: 1.3; }
.link-item.sel { outline: 4px solid #feca57; transform: scale(1.04); }
.link-item.matched { background: #d9f7e8; outline: 3px solid #10c98a; opacity: .72; pointer-events: none; }
.link-item.bad { animation: shake .35s; background: #ffe3e3; }
.link-emoji { font-size: 34px; }

/* ---------- 拼字 ---------- */
.spell-slots { display: flex; gap: 10px; justify-content: center; margin: 18px 0; flex-wrap: wrap; min-height: 70px; }
.slot { width: clamp(48px, 13vw, 66px); height: clamp(48px, 13vw, 66px); border-radius: 14px;
  border: 3px dashed #b2bec3; background: rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center; font-size: clamp(22px, 6.4vw, 30px); font-weight: 900; }
.slot.fill { border-style: solid; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.1); }
.spell-tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; min-height: 70px; }
.tile { width: clamp(48px, 13vw, 66px); height: clamp(48px, 13vw, 66px); border-radius: 14px;
  background: linear-gradient(180deg, #ffeaa7, #fdcb6e); display: flex; align-items: center;
  justify-content: center; font-size: clamp(22px, 6.4vw, 30px); font-weight: 900; color: #6d4c41;
  cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.14); transition: transform .1s; }
.tile:active { transform: translateY(3px); }
.tile.used { opacity: .22; pointer-events: none; }
.tile.bad { animation: shake .35s; }

/* ---------- 排序 ---------- */
.sort-slots { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto 16px; }
.sort-slot { min-height: 58px; border: 3px dashed #b2bec3; border-radius: 16px; display: flex;
  align-items: center; justify-content: center; font-size: clamp(16px, 4.6vw, 21px); font-weight: 900;
  background: rgba(255,255,255,.5); padding: 8px; text-align: center; }
.sort-slot.bad { animation: shake .35s; border-color: #e8485e; }
.sort-items { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 0 auto; }
.sort-item { background: #fff; border-radius: 16px; padding: 16px; font-size: clamp(17px, 4.8vw, 22px);
  font-weight: 900; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.11); cursor: pointer; transition: transform .1s; }
.sort-item:active { transform: scale(.97); }
.sort-item.placed { opacity: .25; pointer-events: none; }
.sort-num { display: inline-block; width: 28px; height: 28px; border-radius: 50%; background: #eef2fb;
  color: #5b74b8; font-size: 14px; line-height: 28px; margin-right: 8px; }

/* ---------- 消消乐 ---------- */
.eli-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 560px; margin: 14px auto; }
.eli-tile { aspect-ratio: 1; background: #fff; border-radius: 18px; display: flex; align-items: center;
  justify-content: center; font-size: clamp(15px, 4.2vw, 21px); font-weight: 900; text-align: center;
  padding: 4px; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.11); line-height: 1.25; word-break: break-all;
  transition: transform .1s; color: #3a3a5c; }
.eli-tile.picked { outline: 4px solid #feca57; transform: scale(1.04); }
.eli-tile.gone { animation: pop .3s forwards; opacity: 0; pointer-events: none; }
.eli-tile.bad { animation: shake .35s; }

/* ---------- 接接乐 ---------- */
.catch-field { position: relative; height: min(58vh, 460px); max-width: 600px; margin: 8px auto 0;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.85));
  border-radius: 26px; overflow: hidden; touch-action: none; cursor: pointer;
  box-shadow: 0 7px 0 rgba(0,0,0,.1); }
.fall-item { position: absolute; top: -70px; width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: clamp(15px, 4.4vw, 21px);
  font-weight: 900; color: #fff; animation: fallDown linear forwards; text-shadow: 0 1px 2px rgba(0,0,0,.2);
  background: linear-gradient(180deg, #74b9ff, #0984e3); box-shadow: inset -6px -8px 0 rgba(0,0,0,.1); }
.fall-item.ok2 { background: linear-gradient(180deg, #5ff0b0, #10c98a); }
.fall-item.bad2 { background: linear-gradient(180deg, #ff8f9f, #e8485e); }
.fall-item.hitgood { animation: pop .3s forwards; }
.fall-item.hitbad { animation: shake .35s; }
.basket { position: absolute; bottom: 8px; left: 50%; margin-left: -44px; width: 88px; text-align: center;
  font-size: 62px; line-height: 1.1; filter: drop-shadow(0 4px 2px rgba(0,0,0,.18)); z-index: 5; transition: transform .06s; }
.catch-hud { display: flex; justify-content: center; gap: 18px; margin-top: 12px; font-weight: 900;
  color: #3a3a5c; font-size: 18px; }

/* ---------- 结算 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(42, 34, 80, .55); display: flex; align-items: center;
  justify-content: center; z-index: 100; animation: fadeIn .25s; padding: 16px; }
.result-card { background: #fff; border-radius: 32px; padding: 30px 24px 24px; width: min(92vw, 430px);
  text-align: center; animation: popIn .35s; position: relative; }
.result-emoji { font-size: 58px; }
.result-title { font-size: 28px; font-weight: 900; color: #2d3436; margin-top: 6px; }
.result-stars { font-size: 52px; margin: 14px 0 4px; }
.rstar { display: inline-block; opacity: .22; filter: grayscale(1); transform: scale(.8); margin: 0 4px; }
.rstar.lit { animation: starIn .45s forwards; }
.result-sub { color: #6a7390; font-weight: 700; margin: 6px 0 18px; line-height: 1.5; }
.result-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confetti-piece { position: fixed; top: -24px; width: 12px; height: 18px; z-index: 101; border-radius: 3px;
  animation: drop linear forwards; pointer-events: none; }

/* ---------- 成就墙 ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 620px; margin: 16px auto; }
.ach-card { background: #fff; border-radius: 22px; padding: 18px 12px; text-align: center;
  box-shadow: 0 5px 0 rgba(0,0,0,.08); }
.ach-card .a-emoji { font-size: 42px; display: block; }
.ach-card .a-name { font-weight: 900; margin-top: 8px; color: #2d3436; }
.ach-card .a-desc { font-size: 12px; color: #8a93a6; margin-top: 4px; font-weight: 600; line-height: 1.4; }
.ach-card.locked { filter: grayscale(1); opacity: .55; }
.ach-card .a-date { font-size: 11px; color: #10c98a; font-weight: 800; margin-top: 4px; }
.ach-stats { text-align: center; color: #3a3a5c; font-weight: 800; padding-top: 8px; }

/* ---------- 设置 ---------- */
.set-card { max-width: 560px; margin: 16px auto; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 16px 4px; border-bottom: 2px dashed #eef1f8; }
.set-row:last-child { border-bottom: none; }
.set-row .sr-emoji { font-size: 26px; }
.set-row .sr-text { flex: 1; }
.set-row .sr-name { font-weight: 900; color: #2d3436; }
.set-row .sr-desc { font-size: 12px; color: #8a93a6; font-weight: 600; margin-top: 2px; }
.toggle { width: 62px; height: 34px; border-radius: 999px; background: #dfe6f2; border: none;
  position: relative; cursor: pointer; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: left .2s; }
.toggle.on { background: #10c98a; }
.toggle.on::after { left: 32px; }

/* ---------- 每日挑战 ---------- */
.daily-hero { text-align: center; padding: 22px 0 10px; }
.daily-hero .d-emoji { font-size: 64px; }
.daily-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 480px; margin: 14px auto; }
.dday { aspect-ratio: 1; border-radius: 14px; background: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 900; color: #8a93a6; font-size: 13px; box-shadow: 0 3px 0 rgba(0,0,0,.07); }
.dday.hit { background: linear-gradient(180deg, #ffd36b, #ffab4a); color: #fff; }
.dday.today { outline: 3px solid #ff6b6b; }

/* ---------- 弹窗 / 提示 / 连击 ---------- */
.modal-box { background: #fff; border-radius: 28px; padding: 26px 22px; width: min(90vw, 420px);
  text-align: center; animation: popIn .3s; }
.modal-title { font-size: 22px; font-weight: 900; color: #2d3436; margin-bottom: 10px; }
.modal-text { color: #6a7390; font-weight: 600; line-height: 1.6; margin-bottom: 18px; }
.modal-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 13%; transform: translateX(-50%); background: rgba(45, 52, 84, .93);
  color: #fff; padding: 13px 22px; border-radius: 999px; font-weight: 800; z-index: 130;
  animation: toastIn .25s; max-width: 86vw; text-align: center; font-size: 15px; }
.combo-chip { position: fixed; top: 74px; right: 16px; z-index: 60; background: linear-gradient(180deg, #ff9f43, #ff6b6b);
  color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 900; animation: comboPop .3s;
  box-shadow: 0 5px 0 rgba(0,0,0,.15); font-size: 15px; }

/* ---------- 动画 ---------- */
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes floaty { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-18px) rotate(5deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-5px); } }
@keyframes rise { to { transform: translateY(-620px); } }
@keyframes starIn { from { opacity: .22; filter: grayscale(1); transform: scale(.8); } 60% { transform: scale(1.35); } to { opacity: 1; filter: none; transform: scale(1); } }
@keyframes drop { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes comboPop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fallDown { to { transform: translateY(620px); } }
@keyframes ufoSway { from { margin-left: 0; } to { margin-left: 40px; } }
@keyframes ufoDrop { to { transform: translateY(320px) rotate(28deg); opacity: 0; } }

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
  .logo { font-size: 34px; }
  .grade-card { min-width: 132px; }
  .mem-grid { gap: 8px; }
  .mole-field { gap: 10px; }
  .hole { height: 104px; }
  .mole { height: 84px; }
  .balloon-field { height: 360px; }
}
@media (min-width: 1000px) {
  .screen { max-width: 760px; margin: 0 auto; border-left: 1px solid rgba(255,255,255,.3); border-right: 1px solid rgba(255,255,255,.3); }
}