/*
 * 单词世界 8 个 3D 场景共用的界面皮肤 + 手机 / iPad 适配。
 * 每个场景模板 <head> 里先写自己的 <style>，再引这个文件，所以同样的选择器以这里为准。
 *
 *   ⓪ 皮肤：磨砂玻璃面板、带高光和底边的「果冻」按钮、底部房间坞、单词标签、宠物气泡、各种面板 / 弹窗，
 *      以及进场的标题卡（#wwIntro，由 /js/word-world.js 插入）和 HUD 入场动画。只改外观，不改结构；
 *   ① 刘海屏：横屏时左右两边让出 safe-area；
 *   ② 小笔记本 / iPad（≤1499px）：右上角按钮只留图标（文字留给读屏），左上角卡片限宽，两边不再叠在一起；
 *   ③ 手机竖屏（≤760px）：场景切换改成一行横向滑动，房间坞铺满底部，宠物气泡不压右下角的大按钮；
 *   ④ 手机横屏（高 ≤500px）：顶部卡片、右侧大按钮、宠物、底部房间条全部变紧凑，对话 / 单词卡面板改到右侧。
 *
 * 模板自己的 @media (max-width: 760px) 写在前面，会被 ⓪ 的同名属性盖掉，所以 ⓪ 改过的尺寸在 ③ 里重新写一遍。
 */

/* ================= ⓪ 皮肤 ================= */
:root {
  --ww-glass: linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.68));
  --ww-glass-solid: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,251,243,.94));
  --ww-blur: blur(16px) saturate(1.6);
  --ww-edge: rgba(255,255,255,.75);
  --ww-hair: rgba(43,34,64,.10);
  --ww-float: inset 0 1px 0 rgba(255,255,255,.95), 0 2px 6px rgba(43,34,64,.08), 0 18px 40px -14px rgba(43,34,64,.42);
  --ww-lift: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(43,34,64,.05), 0 2px 0 rgba(43,34,64,.07), 0 8px 18px -8px rgba(43,34,64,.38);
  --ww-sun: linear-gradient(180deg, #FFE48A, #FFCB3D 55%, #F7B500);
  --ww-sun-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 0 rgba(190,120,0,.2), 0 3px 0 rgba(205,140,0,.5), 0 8px 16px -6px rgba(242,169,0,.6);
  --ww-grass: linear-gradient(180deg, #74E8A4, #36C473 55%, #22A85C);
  --ww-grass-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,90,40,.2), 0 3px 0 rgba(22,125,64,.55), 0 8px 16px -6px rgba(34,168,92,.6);
  --shadow: var(--ww-float);
  --shadow-sm: 0 1px 2px rgba(43,34,64,.10), 0 6px 14px -6px rgba(43,34,64,.30);
}

/* 3D 画面：四角压暗一点、上方一层暖光，画面更有景深；标签浮在暗角上面 */
#view::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(75% 75% at 50% 45%, rgba(28,18,58,0) 58%, rgba(28,18,58,.26) 100%),
              linear-gradient(180deg, rgba(255,232,190,.12), rgba(255,232,190,0) 28%); }
#labels { z-index: 1; }

/* ---- 单词标签：白色胶囊 + 一圈彩色光晕；没学过的会轻轻「呼吸」，提示可以点 ---- */
.lab { border-width: 2px; border-color: #FFC93C; background: rgba(255,255,255,.95); padding: 4px 12px 4px 8px; font-weight: 800; letter-spacing: .005em;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(255,201,60,.22), 0 4px 10px -3px rgba(43,34,64,.4); transition: box-shadow .15s, background-color .15s; }
.lab:hover { background: #fff; box-shadow: inset 0 1px 0 #fff, 0 0 0 5px rgba(255,201,60,.38), 0 6px 14px -3px rgba(43,34,64,.45); }
.lab.seen { border-color: #3CC77A; background: rgba(238,255,245,.95); box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(60,199,122,.18), 0 4px 10px -3px rgba(43,34,64,.35); }
.lab.nav { border-color: rgba(255,255,255,.9); background: linear-gradient(180deg, #6CC8FF, #2E9BEF); text-shadow: 0 1px 0 rgba(0,60,120,.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 3px rgba(46,155,239,.25), 0 5px 12px -3px rgba(20,90,170,.55); }
.lab.q { border-color: #8B5CF6; background: rgba(245,240,255,.96); box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(139,92,246,.2), 0 4px 10px -3px rgba(43,34,64,.4); }
.lab:not(.seen):not(.nav):not(.q):not(.hint)::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid rgba(255,201,60,.85);
  pointer-events: none; animation: wwRing 2.8s ease-out infinite; }
.lab:nth-child(3n+2)::before { animation-delay: .9s; }
.lab:nth-child(3n)::before { animation-delay: 1.8s; }
@keyframes wwRing { 0% { transform: scale(1); opacity: .9; } 55%, 100% { transform: scale(1.18, 1.5); opacity: 0; } }

/* ---- 通用按钮：白色玻璃胶囊，悬停微微抬起，按下压下去 ---- */
.chip { border: 1px solid var(--ww-hair); background: var(--ww-glass-solid); box-shadow: var(--ww-lift);
  transition: transform .16s cubic-bezier(.3,1.6,.5,1), box-shadow .16s, background-color .16s, filter .16s; }
.chip:hover:not(:disabled) { transform: translateY(-1px); }
.chip:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(43,34,64,.14); }
.chip.primary { background: var(--ww-sun); border-color: rgba(214,150,0,.5); color: #3A2A00; box-shadow: var(--ww-sun-shadow); }
.chip.go { background: var(--ww-grass); border-color: rgba(20,120,60,.45); color: #fff; text-shadow: 0 1px 0 rgba(0,80,30,.35); box-shadow: var(--ww-grass-shadow); }
.x { border: 1px solid var(--ww-hair); background: rgba(43,34,64,.05); color: var(--muted); transition: background-color .15s, color .15s, transform .15s; }
.x:hover { background: rgba(43,34,64,.1); color: var(--fg); }
.x:active { transform: scale(.94); }

/* ---- 左上角状态卡：磨砂玻璃 ---- */
#hudL { background: var(--ww-glass); -webkit-backdrop-filter: var(--ww-blur); backdrop-filter: var(--ww-blur); border: 1px solid var(--ww-edge);
  border-radius: 24px; padding: 10px 12px 12px 14px; box-shadow: var(--ww-float); }
#hudL .title { font-size: 25px; letter-spacing: -.01em; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
#hudL .title small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: rgba(43,34,64,.5); text-shadow: none; }
.stats { gap: 6px; }
.pill { border: 1px solid rgba(43,34,64,.06); background: rgba(255,255,255,.75); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(43,34,64,.06); padding: 4px 10px 4px 8px; }
#starPill { background: linear-gradient(180deg, #FFF7D6, #FFE79C); border-color: rgba(230,170,0,.28); }
.pill.words { background: linear-gradient(180deg, #ECF8FF, #D5EFFF); border-color: rgba(58,134,255,.18); }
.pill.fire { background: linear-gradient(180deg, #FFF0E6, #FFDAC6); border-color: rgba(255,120,60,.22); }
#hudL .bar { height: 10px; border-radius: 999px; background: rgba(43,34,64,.08); box-shadow: inset 0 1px 2px rgba(43,34,64,.14); }
#hudL .bar i { border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 60%), repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 6px, rgba(255,255,255,0) 6px 12px), linear-gradient(90deg, #36C473, #36B5F2);
  background-size: auto, 17px 17px, auto; animation: wwStripes 1.6s linear infinite; box-shadow: 0 0 8px rgba(54,181,242,.45); }
@keyframes wwStripes { to { background-position: 0 0, 17px 0, 0 0; } }
/* 宽屏：标题和星星 / 进度数字排在同一行，卡片矮一截 */
@media (min-width: 1200px) {
  #hudL { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; }
  #hudL .title { margin: 0; }
  #hudL .stats { justify-content: flex-end; }
  #hudL .bar, #hudL .scenes { grid-column: 1 / -1; }
}
/* 场景切换：一条分段控件，当前场景是黄色果冻块 */
.scenes { gap: 3px; margin-top: 10px; padding: 4px; border-radius: 16px; background: rgba(43,34,64,.06); box-shadow: inset 0 1px 2px rgba(43,34,64,.08); }
.scene { border-radius: 12px; background: transparent; color: #4A4062; font-size: 13.5px; transition: background-color .15s, transform .15s; }
a.scene:hover { background: rgba(255,255,255,.85); transform: translateY(-1px); }
.scene.on { background: var(--ww-sun); color: #3A2A00; box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 2px 0 rgba(205,140,0,.45), 0 4px 10px -3px rgba(242,169,0,.55); }
.scene small { color: rgba(43,34,64,.5); }
.scene.on small { color: rgba(58,42,0,.6); }

/* ---- 右上角：玻璃圆钮 ---- */
#hudR { align-items: center; }
#hudR .chip { min-height: 46px; min-width: 46px; background: var(--ww-glass); -webkit-backdrop-filter: var(--ww-blur); backdrop-filter: var(--ww-blur); border-color: var(--ww-edge); box-shadow: var(--ww-float); }
#hudR .chip.go { background: var(--ww-grass); border-color: rgba(20,120,60,.45); box-shadow: var(--ww-grass-shadow); -webkit-backdrop-filter: none; backdrop-filter: none; }
#hudR .chip .e { font-size: 19px; }

/* ---- 右下角大按钮：果冻质感（顶部高光、底部厚边、彩色投影），主按钮上有一道扫光 ---- */
.fab { position: relative; overflow: hidden; isolation: isolate; border: 2px solid rgba(255,255,255,.65); text-shadow: 0 1px 0 rgba(0,0,0,.2);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.14), 0 4px 0 rgba(43,34,64,.18), 0 14px 26px -10px rgba(43,34,64,.55);
  transition: transform .16s cubic-bezier(.3,1.6,.5,1), box-shadow .16s, filter .16s; }
.fab::before { content: ""; position: absolute; z-index: -1; left: 8%; right: 8%; top: 2px; height: 48%; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); pointer-events: none; }
.fab.hunt::after, .fab.talk::after { content: ""; position: absolute; z-index: -1; top: -30%; bottom: -30%; left: 0; width: 34%; pointer-events: none;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.55), rgba(255,255,255,0)); transform: translateX(-140%) skewX(-18deg); animation: wwShine 4.6s ease-in-out infinite; }
.fab.talk::after { animation-delay: 2.3s; }
@keyframes wwShine { 0%, 60% { transform: translateX(-140%) skewX(-18deg); } 100% { transform: translateX(340%) skewX(-18deg); } }
.fab .e { filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.fab:hover:not(:disabled) { filter: brightness(1.06) saturate(1.05); }
#fabs .fab:active:not(:disabled) { animation: none; transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -2px 0 rgba(0,0,0,.12), 0 1px 0 rgba(43,34,64,.18), 0 6px 12px -6px rgba(43,34,64,.5); }
.fab.talk small { background: rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

/* ---- 底部房间坞：一条磨砂玻璃底座，房间按钮平放在里面，当前房间是黄色果冻块 ---- */
#zonebar { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); justify-content: flex-start;
  gap: 4px; padding: 6px; border-radius: 22px; background: var(--ww-glass); -webkit-backdrop-filter: var(--ww-blur); backdrop-filter: var(--ww-blur);
  border: 1px solid var(--ww-edge); box-shadow: var(--ww-float); }
#zonebar .chip { min-height: 46px; padding: 0 12px 0 10px; border-radius: 16px; border-color: transparent; background: transparent; box-shadow: none; }
#zonebar .chip:hover:not(:disabled) { background: rgba(255,255,255,.8); }
#zonebar .chip.primary { transform: none; background: var(--ww-sun); border-color: rgba(214,150,0,.5); box-shadow: var(--ww-sun-shadow); }
#zonebar .chip small { background: rgba(43,34,64,.07); color: rgba(43,34,64,.6); }
#zonebar .chip.primary small { background: rgba(255,255,255,.55); color: #6B4E00; }
#zonebar .chip.done small { background: #36C473; color: #fff; }

/* ---- 宠物向导和对话气泡 ---- */
#pipSvg { filter: drop-shadow(0 8px 10px rgba(43,34,64,.28)); }
#bubble { border: 1px solid rgba(255,255,255,.85); border-radius: 20px; padding: 10px 16px; background: rgba(255,255,255,.93);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--ww-float); }
#bubble::before { content: none; }
#bubble::after { left: -7px; bottom: 18px; width: 14px; height: 14px; border: 0; background: rgba(255,255,255,.93); transform: rotate(45deg); border-radius: 0 0 0 4px;
  box-shadow: -3px 3px 6px -3px rgba(43,34,64,.25); }

/* ---- 寻宝条 ---- */
#huntBar { border: 1px solid var(--ww-edge); border-radius: 24px; background: rgba(255,255,255,.9); -webkit-backdrop-filter: var(--ww-blur); backdrop-filter: var(--ww-blur);
  box-shadow: inset 0 3px 0 var(--berry), var(--ww-float); }
#huntBar .tag { background: linear-gradient(180deg, #FF8DB3, #FF5C8A); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 6px -2px rgba(255,92,138,.6); }
#huntBar .dots i { box-shadow: inset 0 1px 2px rgba(43,34,64,.18); }
.spk { background: linear-gradient(180deg, #62C7FF, #2E9BEF); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -3px 0 rgba(0,60,140,.2), 0 3px 0 rgba(20,100,190,.35), 0 8px 16px -6px rgba(46,155,239,.6); transition: transform .15s; }
.spk:hover { transform: translateY(-1px); }

/* ---- 单词卡、单词表等侧面板 ---- */
.side { border: 1px solid rgba(255,255,255,.85); border-radius: 26px; background: rgba(255,255,255,.95); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: inset 0 1px 0 #fff, 0 4px 10px rgba(43,34,64,.08), 0 30px 60px -20px rgba(43,34,64,.5); }
#card { border-color: rgba(255,255,255,.85); box-shadow: inset 0 4px 0 #FFC93C, 0 4px 10px rgba(43,34,64,.08), 0 30px 60px -20px rgba(43,34,64,.5); }
.eyebrow { letter-spacing: .04em; }
.bigemo { filter: drop-shadow(0 6px 6px rgba(43,34,64,.22)); }
.exbox { border: 1px solid rgba(58,134,255,.14); background: linear-gradient(180deg, #F3FAFF, #E8F5FF); }
.tip { border: 1px solid rgba(242,169,0,.18); }
.newstar { background: var(--ww-sun); box-shadow: var(--ww-sun-shadow); }
.row { border: 1px solid var(--ww-hair); border-radius: 14px; box-shadow: 0 1px 0 rgba(43,34,64,.04); transition: border-color .15s, background-color .15s; }
.row:hover { border-color: rgba(43,34,64,.22); }
.row.seen { border-color: rgba(54,196,115,.45); }
.vbox select { border: 1px solid rgba(43,34,64,.16); }

/* ---- 弹窗：贴纸册、听音选图、庆祝 ---- */
.modal { background: rgba(30,20,60,.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mcard { border: 1px solid rgba(255,255,255,.85); border-radius: 28px; background: var(--ww-glass-solid);
  box-shadow: inset 0 4px 0 #FFC93C, 0 6px 14px rgba(20,10,50,.12), 0 40px 80px -24px rgba(20,10,50,.6); }
.stk { border: 1px solid rgba(242,169,0,.14); }
.opt { border: 2px solid var(--ww-hair); box-shadow: 0 2px 0 rgba(43,34,64,.06), 0 10px 18px -10px rgba(43,34,64,.35); transition: transform .16s cubic-bezier(.3,1.6,.5,1), border-color .15s; }
.opt:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(139,92,246,.45); }
.opt.ok { border-color: var(--grass); }
.opt.bad { border-color: var(--berry); }

/* ---- 对话面板 ---- */
#talk { border: 2px solid rgba(58,134,255,.55); border-radius: 26px; box-shadow: var(--ww-float); }
.thead { background: linear-gradient(180deg, #F0F6FF, #E3EEFF); border-bottom: 1px solid rgba(58,134,255,.16); }
.tbody { background: linear-gradient(180deg, #F7FAFF, #F2F7FF); }
.tfoot { border-top: 1px solid rgba(58,134,255,.12); }
.msg .bb { box-shadow: 0 1px 2px rgba(43,34,64,.08), 0 6px 14px -8px rgba(43,34,64,.3); }
.msg.them .bb { border: 1px solid rgba(58,134,255,.18); }
.msg.me .bb { background: linear-gradient(180deg, #5C9DFF, #2F7BF5); }
.topt, .scn { border: 2px solid var(--ww-hair); box-shadow: 0 1px 0 rgba(43,34,64,.05); transition: border-color .15s, transform .16s cubic-bezier(.3,1.6,.5,1); }
.topt:hover:not(:disabled), .scn:hover { border-color: #9CC2FF; transform: translateY(-1px); }
.topt.ok { border-color: var(--grass); }
.topt.bad { border-color: var(--berry); }
.scn.here { border-color: #3A86FF; }
.scn.done { border-color: var(--grass); }

#sndTip { border: 1px solid var(--ww-edge); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: inset 0 3px 0 var(--berry), var(--ww-float); }

/* 不支持磨砂玻璃的浏览器：面板改成几乎不透明，字仍然清楚 */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #hudL, #zonebar, #hudR .chip:not(.go) { background: rgba(255,255,255,.95); }
}

/* ---- 进场标题卡（/js/word-world.js 插入）：场景名、进度、玩法，一个大大的「开始探索」 ---- */
#wwIntro { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 64px 18px 18px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, rgba(255,246,224,.08), rgba(26,16,56,.62)); -webkit-backdrop-filter: blur(7px) saturate(1.25); backdrop-filter: blur(7px) saturate(1.25);
  animation: wiIn .35s ease-out both; }
#wwIntro.out { animation: wiOut .5s ease-in forwards; pointer-events: none; }
#wwIntro.out .wi-card { animation: wiZoom .5s cubic-bezier(.5,0,.75,0) forwards; }
.wi-card { position: relative; width: min(440px, 100%); padding: 66px 26px 22px; border-radius: 34px; text-align: center; color: var(--fg, #2B2240);
  background: var(--ww-glass-solid); border: 1px solid rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 8px rgba(255,255,255,.16), 0 40px 90px -24px rgba(16,8,44,.75); animation: wiPop .7s cubic-bezier(.2,1.35,.4,1) both; }
.wi-badge { position: absolute; left: 50%; top: -54px; width: 112px; height: 112px; margin-left: -56px; border-radius: 50%; display: grid; place-items: center; font-size: 58px; line-height: 1;
  background: radial-gradient(circle at 34% 28%, #FFF7CF, #FFCB3D 58%, #F2A900);
  box-shadow: inset 0 4px 0 rgba(255,255,255,.6), inset 0 -7px 0 rgba(190,120,0,.25), 0 0 0 6px #fff, 0 16px 30px -8px rgba(242,169,0,.8); animation: wiBob 3.2s ease-in-out infinite; }
.wi-badge span { filter: drop-shadow(0 4px 4px rgba(120,70,0,.3)); }
.wi-badge::before, .wi-badge::after { content: "✦"; position: absolute; color: #FFC93C; text-shadow: 0 0 10px rgba(255,201,60,.9); animation: wiTwinkle 2.2s ease-in-out infinite; }
.wi-badge::before { left: -26px; top: 18px; font-size: 22px; }
.wi-badge::after { right: -20px; top: -2px; font-size: 15px; animation-delay: 1.1s; }
.wi-kicker { display: inline-block; margin: 0 0 8px; padding: 5px 14px; border-radius: 999px; background: rgba(139,92,246,.1); font: 800 14px/1.2 var(--round, system-ui); letter-spacing: .04em; color: #7246E8; }
.wi-card h1 { margin: 0; font: 800 clamp(32px, 9vw, 42px)/1.05 var(--round, system-ui); letter-spacing: -.015em; }
.wi-lead { margin: 10px auto 0; max-width: 32ch; text-wrap: balance; font: 600 16px/1.5 var(--sans, system-ui); color: #4A4062; min-height: 1.5em; }
.wi-lead:lang(zh), .wi-lead:lang(ja) { word-break: keep-all; overflow-wrap: anywhere; }
.wi-prog { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; font: 800 14px/1 var(--round, system-ui); color: #4A4062; white-space: nowrap; }
.wi-prog[hidden] { display: none; }
.wi-bar { flex: 1; height: 12px; border-radius: 999px; background: rgba(43,34,64,.08); box-shadow: inset 0 1px 2px rgba(43,34,64,.14); overflow: hidden; }
.wi-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 60%), linear-gradient(90deg, #36C473, #36B5F2); transition: width .9s cubic-bezier(.2,.9,.3,1) .2s; }
.wi-modes { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 0; padding: 0; }
.wi-modes li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(43,34,64,.05); border: 1px solid rgba(43,34,64,.06); font: 700 14px/1 var(--round, system-ui); color: #4A4062; animation: wiPop .5s cubic-bezier(.2,1.4,.4,1) both; }
.wi-modes li:nth-child(2) { animation-delay: .06s; } .wi-modes li:nth-child(3) { animation-delay: .12s; } .wi-modes li:nth-child(4) { animation-delay: .18s; } .wi-modes li:nth-child(n+5) { animation-delay: .24s; }
.wi-go { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 66px; margin: 20px 0 0; padding: 0 20px;
  border: 0; border-radius: 22px; cursor: pointer; font: 800 23px/1 var(--round, system-ui); color: #fff; text-shadow: 0 1px 0 rgba(0,80,30,.35); background: var(--ww-grass);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -5px 0 rgba(0,90,40,.22), 0 5px 0 #1C8A4B, 0 18px 32px -12px rgba(34,168,92,.85); transition: transform .16s cubic-bezier(.3,1.6,.5,1), box-shadow .16s, filter .16s; }
.wi-go::after { content: ""; position: absolute; z-index: -1; top: -30%; bottom: -30%; left: 0; width: 30%; background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.6), rgba(255,255,255,0));
  transform: translateX(-140%) skewX(-18deg); animation: wwShine 3.2s ease-in-out .8s infinite; }
.wi-go:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.wi-go:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,90,40,.2), 0 1px 0 #1C8A4B, 0 8px 16px -8px rgba(34,168,92,.8); }
.wi-go:disabled { cursor: progress; filter: saturate(.5) brightness(1.05); }
.wi-go:disabled::after { animation: none; opacity: 0; }
.wi-go .play { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); font-size: 14px; padding-left: 3px; }
.wi-go:disabled .play { padding-left: 0; }
.wi-go:disabled .play::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; animation: wwspin .8s linear infinite; }
.wi-go:disabled .play b { display: none; }
@keyframes wwspin { to { transform: rotate(360deg); } }
.wi-tip { margin: 12px 0 0; font: 500 13px/1.45 var(--sans, system-ui); color: var(--muted, #6E6585); }
/* 卡片四周漂浮的单词 emoji：这个场景里藏着的东西 */
.wi-float { position: absolute; z-index: -1; pointer-events: none; font-size: 40px; line-height: 1; opacity: 0; filter: drop-shadow(0 8px 10px rgba(16,8,44,.35)); animation: wiDrift 6s ease-in-out infinite, wiFadeIn .8s ease-out forwards; }
@keyframes wiIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes wiOut { to { opacity: 0; } }
@keyframes wiPop { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes wiZoom { to { opacity: 0; transform: scale(1.12); } }
@keyframes wiBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes wiTwinkle { 0%, 100% { opacity: .3; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes wiDrift { 0%, 100% { translate: 0 0; rotate: -6deg; } 50% { translate: 0 -14px; rotate: 6deg; } }
@keyframes wiFadeIn { to { opacity: .95; } }

/* 标题卡打开时先藏起 HUD；点「开始」后 HUD 从四边依次滑进来 */
.ww-intro-on .hud, .ww-intro-on #labels { visibility: hidden; }
.ww-enter #hudL { animation: wwInL .6s cubic-bezier(.2,1.3,.4,1) both; }
.ww-enter #hudR { animation: wwInT .6s cubic-bezier(.2,1.3,.4,1) .06s both; }
.ww-enter #fabs { animation: wwInR .65s cubic-bezier(.2,1.3,.4,1) .14s both; }
.ww-enter #zonebar { animation: wwInB .65s cubic-bezier(.2,1.3,.4,1) .2s both; }
.ww-enter #pip { animation: wwInL .65s cubic-bezier(.2,1.3,.4,1) .3s both; }
.ww-enter #labels { animation: wiIn .6s ease-out .35s both; }
@keyframes wwInL { from { opacity: 0; translate: -40px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes wwInR { from { opacity: 0; translate: 40px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes wwInT { from { opacity: 0; translate: 0 -30px; } to { opacity: 1; translate: 0 0; } }
@keyframes wwInB { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .lab::before, .fab::after, .wi-go::after { display: none; }
  #hudL .bar i { animation: none; }
}

/* ================= ① 刘海 / 圆角屏 ================= */
#hudL, #pip { margin-left: env(safe-area-inset-left, 0px); }
#hudR, #fabs { margin-right: env(safe-area-inset-right, 0px); }
#zonebar { max-width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
#zonebar { -webkit-overflow-scrolling: touch; }

/* 场景切换横向滑动时用的样式（③ ④ 里打开） */
.scenes.ww-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }

/* ================= ② 小笔记本 / iPad：右上角只留图标 ================= */
@media (min-width: 761px) and (max-width: 1499px) {
  #hudR .chip:not(#goBtn):not(.whLangWrap) { padding: 0; width: 46px; }
  #hudR .chip:not(#goBtn) .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  #hudL { min-width: 0; max-width: calc(100% - 470px); }
}
@media (min-width: 761px) and (max-width: 1199px) {
  #hudL { max-width: calc(100% - 440px); }
  #hudL .title small { display: none; }
  .scene small { display: none; }
  #hudR { max-width: 400px; }
  #pip { max-width: calc(100% - 280px); }
}

/* ================= ③ 手机竖屏 ================= */
@media (max-width: 760px) {
  #hudL { padding: 7px 10px 9px; border-radius: 18px; }
  #hudL .title { font-size: 20px; }
  .scenes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-top: 8px; margin-right: 0; padding: 3px; border-radius: 14px; }
  .scenes::-webkit-scrollbar { display: none; }
  .scene { flex: none; min-height: 30px; padding: 0 8px; font-size: 13px; border-radius: 11px; }
  .pill { padding: 3px 7px; }
  #hudR .chip { min-height: 42px; min-width: 42px; padding: 0 11px; }
  #hudR .chip:not(#goBtn):not(.whLangWrap) { padding: 0; width: 42px; }
  #hudR .chip .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  #hudR #goBtn .t { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }
  #zonebar { left: 6px; right: 6px; bottom: 6px; transform: none; width: auto; max-width: none; padding: 4px; border-radius: 18px; }
  #zonebar .chip { min-height: 44px; border-radius: 14px; }
  #pip { max-width: calc(100% - 196px); bottom: 70px; }
  #bubble { font-size: 13px; line-height: 1.35; padding: 7px 11px; border-radius: 16px; }
  .side { border-radius: 24px 24px 20px 20px; }
  #talk { border-radius: 24px 24px 20px 20px; }
  #fabs { bottom: 74px; }
  .wi-card { padding: 58px 20px 18px; border-radius: 28px; }
  .wi-badge { width: 96px; height: 96px; top: -46px; margin-left: -48px; font-size: 50px; }
  .wi-lead { font-size: 15px; }
  .wi-go { min-height: 60px; font-size: 21px; }
  .wi-float { font-size: 30px; }
}

/* ================= ④ 手机横屏：高度很矮 ================= */
@media (max-height: 500px) and (orientation: landscape) {
  #hudL { top: 6px; left: 8px; min-width: 0; max-width: min(46%, 430px); padding: 5px 10px 6px; border-radius: 16px; }
  #hudL .title { font-size: 18px; margin: 0 0 3px; }
  #hudL .title small { display: none; }
  .stats { font-size: 12px; gap: 5px; }
  .pill { padding: 2px 7px; }
  #hudL .bar { height: 6px; margin-top: 5px; }
  .scenes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-top: 5px; gap: 3px; padding: 2px; border-radius: 12px; }
  .scenes::-webkit-scrollbar { display: none; }
  .scene { flex: none; min-height: 28px; padding: 0 8px; font-size: 12px; border-radius: 10px; }
  .scene small { display: none; }

  #hudR { top: 6px; right: 8px; max-width: 50%; gap: 6px; }
  #hudR .chip { min-height: 38px; min-width: 38px; padding: 0 10px; font-size: 14px; }
  #hudR .chip:not(#goBtn):not(.whLangWrap) { padding: 0; width: 38px; }
  #hudR .chip .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  #hudR #goBtn .t { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }
  #hudR .whLangWrap select { min-height: 32px; max-width: 4.6em; }

  #fabs { right: 8px; bottom: 54px; gap: 6px; }
  #fabs .fab { min-height: 40px; padding: 0 12px 0 8px; font-size: 14px; border-width: 2px; gap: 6px; }
  #fabs .fab .e { font-size: 20px; }
  #fabs .fab small { font-size: 11px; padding: 3px 6px; }

  #pip { left: 4px; bottom: 50px; max-width: calc(100% - 260px); }
  #pipSvg { width: 60px; height: 60px; }
  #petEmo { font-size: 38px; }
  #bubble { font-size: 13px; line-height: 1.35; padding: 5px 10px; margin-bottom: 18px; border-radius: 14px; }
  #bubble small { display: none; }

  #zonebar { left: 6px; right: 6px; bottom: 4px; transform: none; width: auto; max-width: none; padding: 3px; border-radius: 16px; }
  #zonebar .chip { min-height: 36px; font-size: 12px; border-radius: 12px; }
  #zonebar .chip.primary { transform: none; }

  /* 单词卡 / 贴纸等侧面板、对话面板：贴右边，占满高度 */
  .side { left: auto; right: 8px; top: 6px; bottom: 50px; width: min(380px, 52%); max-height: none; padding: 10px 14px 14px; border-radius: 18px; z-index: 7; }
  #talk { left: auto; right: 8px; top: 6px; bottom: 50px; height: auto; width: min(460px, 58%); border-radius: 18px; z-index: 7; }
  #huntBar { top: 6px; bottom: auto; padding: 6px 10px 8px; gap: 4px; z-index: 7; }

  /* 弹窗（听音选图、贴纸册、庆祝） */
  .modal { padding: 6px; }
  .mcard { max-height: calc(100% - 4px); padding: 10px 16px 14px; gap: 8px; border-radius: 20px; }
  .mcard h2 { font-size: 20px; }
  .opt { min-height: 76px; }
  .opt .e { font-size: 32px; }

  /* 标题卡：横排，去掉玩法和提示 */
  #wwIntro { padding: 10px; }
  .wi-card { width: min(520px, 100%); padding: 14px 20px 14px 128px; text-align: left; border-radius: 24px; }
  .wi-badge { left: 18px; top: 50%; margin: -46px 0 0; width: 92px; height: 92px; font-size: 48px; }
  .wi-card h1 { font-size: 30px; }
  .wi-lead { margin: 6px 0 0; font-size: 14px; }
  .wi-prog { margin-top: 10px; }
  .wi-modes, .wi-tip, .wi-float { display: none; }
  .wi-go { min-height: 52px; margin-top: 12px; font-size: 19px; }
}
