/* ============================================================
   adventure.css — 客厅动作大冒险
   只放：地图 / 站点 / 花样卡 / 指令卡 / 插画适配 / 终点 /
        4 个新 pose / 全屏 / 响应式 / reduced-motion
   ============================================================ */

html, body { overflow-x: hidden; }

/* ---------- 皮肤变量 ---------- */
.board[data-skin="sea"] {
  --skin-bg: linear-gradient(180deg, #E8F7FB 0%, #D9F5F0 55%, #C8ECF7 100%);
  --skin-ink: #1B8F82;
}
.board[data-skin="space"] {
  --skin-bg: linear-gradient(180deg, #1B2340 0%, #2A3A66 55%, #3B2D5C 100%);
  --skin-ink: #E8F7FB;
}
.board[data-skin="zoo"] {
  --skin-bg: linear-gradient(180deg, #EAF8DA 0%, #D9F0C0 55%, #C8E8A8 100%);
  --skin-ink: #2F7A3A;
}

/* ---------- 关卡板 ---------- */
.board {
  position: relative;
  margin-top: 16px;
  padding: 18px 16px 16px;
  border: 2px solid rgba(199, 91, 31, .14);
  border-radius: 32px;
  background: var(--skin-bg, linear-gradient(180deg, #fff, #FFFDF8));
  box-shadow: var(--shadow), 0 4px 0 #F6DFC8, inset 0 1px 0 #fff;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}
.scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.scene svg { display: block; width: 100%; height: 100%; }

/* ---------- 6 个站点 ---------- */
.path {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.station {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.station .dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px dashed #D9C3AA;
  opacity: .62;
  filter: grayscale(.5);
  box-shadow: 0 3px 0 rgba(199, 91, 31, .08);
  transition: opacity .25s ease, filter .25s ease, border-color .25s ease,
    background .25s ease, transform .25s ease;
}
.station .dot svg { display: block; width: 26px; height: 26px; }
.station .star {
  font-size: 17px;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px #D9C3AA;
  transition: color .25s ease, transform .25s ease, -webkit-text-stroke .25s ease;
}
.station.is-current .dot {
  opacity: 1;
  filter: none;
  border-style: solid;
  border-color: var(--pri);
  animation: stationPulse 1.2s ease-in-out infinite;
}
.station.is-done .dot {
  opacity: 1;
  filter: none;
  border-style: solid;
  border-color: var(--teal);
  background: var(--teal-l);
}
.station.is-done .star {
  color: var(--sun);
  -webkit-text-stroke: 0;
  transform: scale(1.15);
}
@keyframes stationPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 153, 74, .35); }
  50% { box-shadow: 0 0 0 8px rgba(242, 153, 74, 0); }
}

/* ---------- 卡组 ---------- */
.deck {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}

/* ---------- 花样卡 ---------- */
.trick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 #F3DDC7;
  color: var(--teal);
  font-weight: 800;
}
.trick-icon { font-size: 20px; line-height: 1; }
.trick-en { font-size: 14px; letter-spacing: .2px; }
.trick-zh { display: none; font-size: 12px; color: var(--mut); font-weight: 700; }
body.show-zh .trick-zh { display: inline; }
.trick[data-trick="whisper"] { background: var(--teal-l); border-color: rgba(27, 143, 130, .25); color: #0F6B62; }
.trick[data-trick="fast"] { background: #FFF3D6; border-color: #F6D48A; color: #7A4E00; }
.trick[data-trick="slow"] { background: #EAF3FF; border-color: #B9D4F2; color: #2D5F9A; }
.trick[data-trick="animal"] { background: #FFF0F4; border-color: #F7C2D0; color: #B23A5A; }
.trick[data-trick="yours"] { background: #F3ECFF; border-color: #D5C2F5; color: #6B3FA0; }

/* ---------- 指令卡 ---------- */
.cmd-card {
  width: 100%;
  max-width: 560px;
  padding: 8px 14px 6px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  border: 1.5px solid rgba(199, 91, 31, .14);
  box-shadow: 0 6px 18px rgba(199, 91, 31, .08);
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.cmd-card:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.cmd-card .cmd-en { margin-top: 4px; color: var(--pri-d); }
.cmd-card .cmd-zh { display: none; margin-top: 2px; }
body.show-zh .cmd-card .cmd-zh { display: block; }

/* ---------- 插画适配 ---------- */
.cmd-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 172px;
  margin-top: 2px;
  overflow: visible;
}
.cmd-art svg { height: 100%; width: auto; max-width: 100%; overflow: visible; }
.cmd-art .art-svg {
  height: 100%;
  width: auto;
  max-width: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 14px rgba(199, 91, 31, .16));
}
.cmd-art .mascot { height: 100%; width: auto; max-width: 100%; overflow: visible; }
.cmd-art .art {
  opacity: 0;
  transform: scale(.92);
  transform-box: view-box;
  transform-origin: 100px 80px;
  transition: opacity .28s ease, transform .28s cubic-bezier(.34, 1.4, .64, 1);
}
.cmd-art .art.is-on {
  opacity: 1;
  transform: none;
  animation: advPartPulse 1.6s ease-in-out infinite;
}
@keyframes advPartPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(242, 153, 74, .45)); }
  50% { filter: drop-shadow(0 0 18px rgba(242, 153, 74, .85)) drop-shadow(0 0 34px rgba(255, 201, 74, .35)); }
}

/* ---------- 家长提示 ---------- */
.cmd-tip { display: none; width: 100%; max-width: 560px; }
body.show-zh .cmd-tip { display: block; }
body.is-fullscreen.show-zh .cmd-tip { display: block; }

/* ---------- 换题弹跳 ---------- */
.cmd-card.pop .cmd-en {
  animation: advCmdPop .5s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes advCmdPop {
  0% { opacity: 0; transform: translateY(10px) scale(.9); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.03); }
  100% { opacity: 1; transform: none; }
}

/* ---------- 过关按钮 ---------- */
.pass-btn {
  position: relative;
  z-index: 2;
  margin: 12px auto 0;
  width: 100%;
  max-width: 560px;
  min-height: 66px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFB061, var(--pri) 45%, var(--pri-d));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 0 #A94A15, 0 14px 26px rgba(199, 91, 31, .32), inset 0 2px 0 rgba(255, 255, 255, .45);
  transition: transform .14s ease, box-shadow .14s ease, opacity .2s ease;
}
.pass-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #A94A15, 0 6px 14px rgba(199, 91, 31, .3);
}
.pass-btn:disabled {
  opacity: .45;
  cursor: default;
  box-shadow: 0 4px 0 #C58A62, 0 8px 14px rgba(199, 91, 31, .18);
}
.pass-btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }

.footnote {
  position: relative;
  z-index: 2;
  display: table;
  margin: 10px auto 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- 开始遮罩 / 终点 ---------- */
.idle-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: rgba(255, 247, 236, .7);
  backdrop-filter: blur(2px);
  cursor: pointer;
  text-align: center;
}
.idle-title {
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  font-weight: 900;
  color: var(--pri-d);
  letter-spacing: .5px;
  text-shadow: 0 3px 0 #FFE8CE, 0 8px 18px rgba(199, 91, 31, .18);
}
.idle-sub { font-size: 14px; font-weight: 700; color: var(--mut); }
#idleOverlay[hidden], #finale[hidden] { display: none !important; }

#board[data-state="IDLE"] .deck { opacity: .35; filter: grayscale(.4); pointer-events: none; }
#board[data-state="IDLE"] .pass-btn { visibility: hidden; }
#board[data-state="STAGE_CLEAR"] .pass-btn { opacity: .45; pointer-events: none; }
#board[data-state="FINALE"] .deck,
#board[data-state="FINALE"] .pass-btn,
#board[data-state="FINALE"] .footnote { display: none; }

.finale {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 0 4px;
  text-align: center;
}
.finale-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(330px, 78%);
  height: 200px;
}
.finale-art svg { width: 100%; height: 100%; overflow: visible; }
.finale-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  color: var(--pri-d);
  text-shadow: 0 2px 0 #FFE8CE;
}
.board[data-skin="space"] .finale-title {
  color: #FFF7EC;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.finale-stars {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 6px;
  line-height: 1.2;
  color: var(--sun);
  text-shadow: 0 2px 0 #E8B83A;
}
.again-btn {
  margin-top: 4px;
  min-height: 48px;
  padding: 0 26px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 0 #F3DDC7;
}
.again-btn:active { transform: translateY(3px); box-shadow: none; }

/* ---------- 终点动画 ---------- */
.chest-lid { transform-box: fill-box; transform-origin: 50% 100%; }
#board[data-state="FINALE"] .chest-lid { animation: advChest .7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes advChest { from { transform: rotate(0); } to { transform: rotate(-12deg); } }

.rocket { transform-box: fill-box; transform-origin: center; }
#board[data-state="FINALE"] .rocket { animation: advRocket 1.6s ease-in-out infinite alternate; }
@keyframes advRocket { from { transform: translateY(12px); } to { transform: translateY(-18px); } }

.panda { transform-box: fill-box; transform-origin: center bottom; }
#board[data-state="FINALE"] .panda { animation: advPanda 1.2s ease-in-out infinite alternate; }
@keyframes advPanda { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }

/* ---------- 4 个新 pose（只作用于 SIMON_ART） ---------- */
.pose-walk .leg-l { animation: advWalk .55s ease-in-out infinite alternate; }
.pose-walk .leg-r { animation: advWalk .55s ease-in-out infinite alternate-reverse; }
.pose-walk .arm-l { transform: rotate(14deg); }
.pose-walk .arm-r { transform: rotate(-14deg); }
.pose-run .leg-l { animation: advRun .3s linear infinite; }
.pose-run .leg-r { animation: advRun .3s linear infinite reverse; }
.pose-run .arm-l { transform: rotate(28deg); }
.pose-run .arm-r { transform: rotate(-28deg); }
.pose-stop .arm-l { transform: rotate(-24deg); }
.pose-stop .arm-r { transform: rotate(24deg); }
.pose-stop .leg-l { transform: rotate(-6deg); }
.pose-stop .leg-r { transform: rotate(6deg); }
.pose-go .arm-r { transform: rotate(-48deg); }
.pose-go .leg-r { transform: rotate(-10deg); }
@keyframes advWalk { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes advRun { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }

/* ---------- 顶栏豆子 ---------- */
.beans { display: inline-flex; align-items: center; gap: 2px; }
.bean { width: 5px; height: 5px; border-radius: 50%; background: #E3CDB6; transition: background .2s ease; }
.bean.on { background: var(--teal); }

/* ---------- 全屏 ---------- */
body.is-fullscreen .wrap {
  max-width: min(1080px, 96vw);
  height: 100dvh;
  margin: 0 auto;
  padding: min(2.4vh, 22px) 16px;
  display: flex;
  flex-direction: column;
}
body.is-fullscreen .top,
body.is-fullscreen .tips,
body.is-fullscreen .footnote { display: none; }
body.is-fullscreen .board {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  padding: clamp(12px, 2vh, 24px) clamp(12px, 2.2vw, 28px);
}
body.is-fullscreen .path {
  gap: clamp(6px, 1.4vw, 18px);
  margin-bottom: clamp(6px, 1.2vh, 14px);
}
body.is-fullscreen .station .dot {
  width: clamp(36px, 5.2vh, 64px);
  height: clamp(36px, 5.2vh, 64px);
}
body.is-fullscreen .station .dot svg { width: 70%; height: 70%; }
body.is-fullscreen .station .star { font-size: clamp(16px, 3vh, 28px); }
body.is-fullscreen .deck {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: center;
  gap: clamp(6px, 1.2vh, 14px);
}
body.is-fullscreen .trick { padding: clamp(5px, 1vh, 10px) clamp(12px, 2vw, 22px); }
body.is-fullscreen .trick-en { font-size: clamp(14px, 2vh, 20px); }
body.is-fullscreen .cmd-card {
  max-width: min(820px, 88vw);
  padding: clamp(6px, 1.2vh, 16px) clamp(14px, 2.6vw, 34px);
}
body.is-fullscreen .cmd-en { font-size: clamp(2.4rem, 7vw, 6rem); }
body.is-fullscreen .cmd-zh { font-size: clamp(1.05rem, 2.2vw, 2rem); }
body.is-fullscreen .cmd-art { height: clamp(150px, 32vh, 360px); }
body.is-fullscreen .pass-btn { max-width: min(620px, 88vw); }
body.is-fullscreen.show-zh .cmd-tip { display: block; max-width: min(820px, 88vw); }

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
  .board { padding: 24px 24px 20px; }
  .cmd-art { height: 220px; }
  .station .dot { width: 44px; height: 44px; }
  .station .dot svg { width: 30px; height: 30px; }
  .station .star { font-size: 19px; }
}
@media (max-width: 480px) {
  .board { padding: 14px 10px 12px; border-radius: 26px; }
  .path { gap: 2px; margin-bottom: 8px; }
  .station .dot { width: 32px; height: 32px; }
  .station .dot svg { width: 22px; height: 22px; }
  .station .star { font-size: 14px; }
  .trick { padding: 6px 10px; gap: 6px; }
  .trick-en { font-size: 12px; }
  .trick-icon { font-size: 17px; }
  .cmd-card { padding: 6px 10px 4px; border-radius: 20px; }
  .cmd-art { height: 140px; }
  .pass-btn { font-size: 20px; min-height: 66px; }
  .finale-art { height: 170px; }
  .logo .t1 { font-size: 13px; }
  .logo .t2 { display: none; }
  .top-actions { gap: 4px; }
  .icon-btn { width: 44px; min-height: 44px; }
  .icon-btn .icon-label { display: none; }
}
@media (max-height: 760px) {
  body.is-fullscreen .cmd-art { height: clamp(110px, 24vh, 200px); }
  body.is-fullscreen .finale-art { height: clamp(110px, 24vh, 180px); }
}
@media (max-height: 620px) {
  body.is-fullscreen .board { padding-top: 8px; padding-bottom: 8px; }
  body.is-fullscreen .cmd-art { height: 100px; }
  body.is-fullscreen .station .dot { width: 32px; height: 32px; }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  .station.is-current .dot,
  #board[data-state="FINALE"] .chest-lid,
  #board[data-state="FINALE"] .rocket,
  #board[data-state="FINALE"] .panda,
  .cmd-card.pop .cmd-en,
  .cmd-art .art.is-on,
  .pose-walk .leg-l,
  .pose-walk .leg-r,
  .pose-run .leg-l,
  .pose-run .leg-r {
    animation: none !important;
  }
  .station,
  .station .dot,
  .station .star,
  .cmd-card,
  .cmd-art .art,
  .trick,
  .pass-btn,
  .again-btn,
  .icon-btn,
  .toast {
    transition: none !important;
  }
  .pass-btn:active:not(:disabled),
  .again-btn:active,
  .icon-btn:active {
    transform: none !important;
  }
  .confetti { display: none !important; }
}
