/* =========================================================
   宾客端 · 软糯黏土
   主题色背景（.mesh）+ 奶油纸卡片 + 珊瑚红主按钮，画风和头像一致。
   基础变量和组件见 common.css；这里只写手机端自己的布局。
   ========================================================= */

/* 屏幕单位一律用这几个，不直接写 vw / vh / env()：手机横过来时页面会转 90°（js/turn.js），要跟着对调 */
:root {
  --vw: 1vw;
  --vh: 1vh;
  --safe-t: env(safe-area-inset-top);
  --safe-r: env(safe-area-inset-right);
  --safe-b: env(safe-area-inset-bottom);
  --safe-l: env(safe-area-inset-left);
}

html,
body.player {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body.player {
  --gutter: 16px;
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
body.player input {
  user-select: text;
  -webkit-user-select: text;
}

.page {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: var(--safe-t) 0 var(--safe-b);
}

/* ---------- 文字 ---------- */
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.sub b {
  color: var(--ink);
  font-weight: 600;
}
.eyebrow {
  font-size: 13px;
}

/* 新人名字 */
.names {
  margin: 0;
  font-size: clamp(30px, 9.6 * var(--vw), 38px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.hero {
  text-align: center;
  padding: 28px 8px 8px;
}
.hero .eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  margin-bottom: 10px;
}
.hero-sub {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- 卡片 / 输入 / 按钮 ---------- */
.panel {
  border-radius: 30px;
  padding: 18px;
}
.input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: var(--field);
  color: var(--ink);
  font: 500 17px/1.2 var(--font);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 2px 5px rgba(122, 62, 38, 0.12);
}
.input::placeholder {
  color: var(--faint);
  font-weight: 400;
}
.input:focus {
  background: var(--paper-hi);
  box-shadow: 0 0 0 3px var(--accent), inset 0 2px 5px rgba(122, 62, 38, 0.1);
}
.btn-block {
  width: 100%;
  height: 54px;
}
.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  transition: background 0.2s, transform 0.15s;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}
.icon-btn:active {
  background: rgba(74, 42, 34, 0.06);
  transform: scale(0.94);
}
.side-dot {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--side, var(--faint));
}

/* 状态提示（等待司仪 / 看大屏） */
.wait-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--px);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.wait-pill {
  position: relative;
  --px: 18px; /* 左边距：散开的光圈要和圆点对齐 */
}
.wait-pill::before,
.wait-pill::after {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
/* 一圈圈散开的光：只动 transform 和 opacity。等待页停得久，动 box-shadow 会让手机一直重绘、发烫 */
.wait-pill::after {
  position: absolute;
  left: var(--px);
  top: 50%;
  margin-top: -3.5px;
  opacity: 0;
  animation: live 1.8s ease-out infinite;
}
@keyframes live {
  0% {
    opacity: 0.45;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(3.5);
  }
}

/* 加载页的样式在 index.html 里（不等样式表就要能显示） */

/* ---------- 加入页 ---------- */
#join {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.join-scroll {
  flex: none;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) 22px;
}
.join-hero {
  padding: 24px 8px 10px;
  animation: fade-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.join-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px 16px;
  animation: fade-up 0.6s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; /* 不用 both：播完还留着 transform，里面的 fixed 就不认屏幕了 */
}
.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
.field > .label {
  padding-left: 2px;
}
.side-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.side-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 70px;
  padding: 12px 14px;
  border: 0;
  border-radius: 22px;
  background: var(--field);
  color: var(--ink);
  text-align: left;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  box-shadow: inset 0 2px 5px rgba(122, 62, 38, 0.1);
}
.side-btn b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}
.side-btn small {
  font-size: 12px;
  color: var(--muted);
}
.side-btn .side-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  background: var(--accent);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.side-btn .side-check svg {
  width: 13px;
  height: 13px;
}
.side-btn:active {
  transform: scale(0.98);
}
.side-btn.on {
  background: var(--paper-hi);
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-sm);
}
.side-btn.on .side-check {
  opacity: 1;
  transform: none;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 2px;
}
.label-btn {
  margin: -8px -6px;
  padding: 8px 10px;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
}
.avatar-pick .face {
  border-radius: 16px;
}
.avatar-pick {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.avatar-pick button {
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 26px;
  line-height: 1;
  background: var(--field);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.avatar-pick button:active {
  transform: scale(0.92);
}
.avatar-pick button.on {
  background: var(--paper-hi);
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-sm);
  transform: scale(1.04);
}
#join-btn {
  margin-top: 2px;
}
.join-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 顶部个人信息 ---------- */
#me-bar {
  position: relative;
  z-index: 5;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px var(--gutter) 0;
  padding: 8px 4px 8px 8px;
  border-radius: 28px;
}
.me-av {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 25px;
  line-height: 1;
  background: var(--paper-hi);
  box-shadow: 0 2px 6px rgba(122, 62, 38, 0.2);
}
.me-info {
  flex: 1;
  min-width: 0;
}
.me-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.me-meta #me-rank:not(:empty)::before {
  content: '·';
  margin-right: 6px;
}
.me-score {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.me-score b {
  display: inline-block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.me-score small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.me-score.bump b {
  animation: score-bump 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes score-bump {
  35% {
    transform: scale(1.22);
    color: var(--accent);
  }
}

/* ---------- 舞台容器 ---------- */
#view {
  flex: 1;
  min-height: 0;
  position: relative;
}
.stage-box {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 16px var(--gutter) 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: stage-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  scrollbar-width: none;
}
.stage-box::-webkit-scrollbar,
#join::-webkit-scrollbar {
  display: none;
}
#join {
  scrollbar-width: none;
}
@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}
.stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.foot-tip {
  margin: auto 0 0;
  padding-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 规则介绍 ---------- */
.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
}
.intro-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.intro-head .itile {
  margin-bottom: 8px;
}
.intro-head .sub {
  max-width: 300px;
}
.itile-lg {
  width: 72px;
  height: 72px;
}
.rules {
  width: 100%;
  margin: 0;
  padding: 4px 18px;
  list-style: none;
  border-radius: 28px;
  text-align: left;
  counter-reset: r;
}
.rules li {
  counter-increment: r;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  border-top: 1px solid var(--hair);
}
.rules li:first-child {
  border-top: 0;
}
.rules li::before {
  content: counter(r);
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-accent);
  background: var(--accent);
}

/* ---------- 倒计时 ---------- */
.count-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 18px 0;
  border-radius: 38%;
  display: grid;
  place-items: center;
}
.count-ring::after {
  content: '';
  position: absolute;
  top: -16px;
  right: -16px;
  bottom: -16px;
  left: -16px;
  border-radius: 50%;
  border: 0;
}
.count-big {
  font-size: 108px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: count-pop 0.9s cubic-bezier(0.2, 1.2, 0.3, 1) both;
}
.count-big.go {
  font-size: 64px;
  letter-spacing: 0.04em;
  color: var(--accent);
}
@keyframes count-pop {
  0% {
    opacity: 0;
    transform: scale(1.6);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(0.95);
  }
}

/* ---------- 题目 / 计时 ---------- */
.top-row {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}
.q-no {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
}
.timer-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.timer-pill .ico {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.timer-pill .t {
  display: inline-block;
  min-width: 1.15em;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.timer-pill .t.urgent {
  color: var(--accent);
  animation: pulse 0.9s ease-in-out infinite;
}
.timer-pill small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.q-text {
  margin: 0;
  padding: 20px;
  border-radius: 28px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.45;
}
.tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.tip .ico {
  color: var(--ok);
}

/* ---------- 选项（答题 / 默契） ---------- */
.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 44px 10px 10px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  transition: transform 0.15s, opacity 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
}
.opt:active {
  transform: scale(0.98);
}
.opt .shape {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--on-accent);
  background: var(--c);
  transition: background 0.25s;
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.14), inset 0 2px 3px rgba(255, 255, 255, 0.3);
}
.opt .shape svg {
  width: 17px;
  height: 17px;
}
.opt .opt-check {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.opt .opt-check svg {
  width: 100%;
  height: 100%;
}
.opt.picked {
  color: var(--on-accent);
  background: var(--c);
  box-shadow: 0 8px 18px rgba(122, 62, 38, 0.22), inset 0 -4px 7px rgba(0, 0, 0, 0.15), inset 0 3px 5px rgba(255, 255, 255, 0.3);
}
.opt.picked .shape {
  background: rgba(255, 246, 230, 0.24);
}
.opt.picked .opt-check {
  opacity: 1;
  transform: none;
}
.opt.dim {
  opacity: 0.42;
}
/* 默契题：两人并排的大卡片 */
.opts.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.opts.duo .opt {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 168px;
  padding: 18px 10px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}
.opts.duo .opt .duo-face {
  margin-bottom: 4px;
  font-size: 64px;
  line-height: 1;
}
.opts.duo .opt .duo-face .face {
  display: block;
  width: 1em;
  height: 1em;
}
.opts.duo .opt small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.opts.duo .opt.picked small {
  color: rgba(255, 255, 255, 0.82);
}
.opts.duo .opt.dim {
  opacity: 0.6;
}
.opts.duo .opt .opt-check {
  top: 14px;
  right: 14px;
  margin-top: 0;
}

/* ---------- 结果卡 ---------- */
.result-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 22px 22px;
  border-radius: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: card-in 0.55s cubic-bezier(0.2, 1, 0.3, 1) both;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}
.result-card .title {
  font-size: 26px;
}
.mark {
  margin-bottom: 8px;
  display: grid;
  place-items: center;
}
.mark .itile {
  width: 84px;
  height: 84px;
}
.mark.good .itile {
  box-shadow: 0 0 0 5px var(--paper-hi), 0 0 0 9px var(--accent);
}
.mark.gold .itile {
  box-shadow: 0 0 0 5px var(--paper-hi), 0 0 0 9px var(--gold);
}
.mark.soft .itile {
  color: var(--muted);
}
.mark.good .itile.pic,
.mark.gold .itile.pic {
  box-shadow: none;
}
.mark.soft .itile:not(.pic) {
  filter: saturate(0.55);
}
.mark.pic,
.mark.emoji {
  font-size: 96px;
  line-height: 1;
}
.mark.pic .art {
  display: block;
  width: 1em;
  height: 1em;
}
.gain {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  animation: gain-in 0.6s 0.15s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.gain b {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.gain small {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
@keyframes gain-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
.result-card .foot {
  width: 100%;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  font-size: 13px;
  color: var(--muted);
}
.result-card .foot b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.result-wrap {
  gap: 18px;
}

/* ---------- 结果页的前三名 ---------- */
.result-wrap.has-tops {
  gap: 12px;
}
.result-wrap.has-tops .wait-pill {
  display: none;
}
.result-wrap.has-tops .result-card {
  padding: 20px 22px 18px;
}
.has-tops .result-card .mark .itile {
  width: 68px;
  height: 68px;
}
.has-tops .result-card .mark.pic,
.has-tops .result-card .mark.emoji {
  font-size: 76px;
}
.tops {
  width: 100%;
  max-width: 360px;
  padding: 10px 16px 8px;
  border-radius: 26px;
}
.tops .label {
  margin: 0 0 2px;
  text-align: center;
}
.tops ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tops li {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  font-size: 15px;
  animation: fade-up 0.45s var(--wait, 0ms) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* 和大屏一样：季军、亚军、冠军依次亮出来 */
.tops:not(.equal) li:nth-child(1) {
  animation-delay: calc(var(--wait, 0ms) + 0.5s);
}
.tops:not(.equal) li:nth-child(2) {
  animation-delay: calc(var(--wait, 0ms) + 0.25s);
}
.tops.still li {
  animation: none !important;
}
.tops .rk {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tops .rk svg {
  width: 13px;
  height: 13px;
}
.tops .rk-1 {
  background: var(--medal-1);
  color: #6b4410;
}
.tops .rk-2 {
  background: var(--medal-2);
  color: #4a4d55;
}
.tops .rk-3 {
  background: var(--medal-3);
  color: #6b3212;
}
.tops li i {
  flex: none;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
}
.tops li b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-weight: 600;
}
.tops li.me b {
  color: var(--accent);
}
/* 不分名次的（猜拳赢家）居中摆 */
.tops.equal li {
  justify-content: center;
}
.tops.equal li b {
  flex: 0 1 auto;
}
.tops li em {
  flex: none;
  font-style: normal;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ---------- 擦亮幸福：结果页的整张合照 ---------- */
.ph-full {
  flex: none;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--paper-hi);
  box-shadow: 0 0 0 4px var(--paper-hi), var(--shadow-sm);
}
.ph-full canvas,
.ph-view canvas {
  display: block;
  width: 100%;
  height: auto;
}
.ph-view {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 870;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  background: rgba(74, 42, 34, 0.72);
  animation: overlay-in 0.3s ease-out;
}
.ph-view canvas {
  max-width: 620px;
  border-radius: 20px;
}

/* ---------- 流畅模式的彩带和爱心（js/fx.js） ---------- */
.fx-fly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 900;
  border-radius: 3px;
  pointer-events: none;
  contain: strict;
  will-change: transform, opacity;
}
.fx-fly .art {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- 点击飘字 / 连击 ---------- */
/* 位置和动画由 player/common.js 的 tapPop 用 transform 控制，元素轮流复用 */
.tap-pop {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 860;
  pointer-events: none;
  opacity: 0;
  contain: layout paint;
  will-change: transform, opacity;
  padding: 0 8px;
  white-space: nowrap;
  font-style: normal;
  font-weight: 700;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-shadow: 0 1px 0 var(--paper-hi), 0 0 6px var(--paper-hi);
}
.combo-pop {
  position: fixed;
  left: 50%;
  top: 42%;
  z-index: 861;
  pointer-events: none;
  font-style: normal;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--accent);
  animation: combo-pop 0.9s cubic-bezier(0.2, 1.3, 0.4, 1) forwards;
}
@keyframes combo-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -62%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.95);
  }
}

/* ---------- 大厅：祝福 ---------- */
.lobby {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lobby .hero {
  padding-top: 22px;
}
.lobby.no-bless .hero {
  margin: auto 0;
  padding-bottom: 40px;
}
.lobby.no-bless .foot-tip {
  margin-top: 0;
}
.bless-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bless-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.bless-head small {
  font-size: 12px;
  color: var(--faint);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  position: relative;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--field);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s, background 0.2s;
  border: 0;
  box-shadow: inset 0 -2px 4px rgba(122, 62, 38, 0.09), inset 0 2px 2px rgba(255, 255, 255, 0.7);
}
.chip::after {
  /* 扩大点击区域到 44px */
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  bottom: -3px;
  left: -3px;
}
.chip:active {
  transform: scale(0.95);
  background: var(--paper-hi);
}
.bless-send {
  margin-top: 2px;
}

/* ---------- 中奖弹窗 / 加分提示 ---------- */
.overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 880;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(74, 42, 34, 0.5);
  animation: overlay-in 0.3s ease-out;
}
@keyframes overlay-in {
  from {
    opacity: 0;
  }
}
.prize-card {
  width: 100%;
  max-width: 340px;
  padding: 32px 24px 22px;
  border-radius: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.prize-card .mark {
  margin-bottom: 18px;
}
.prize-card .eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
}
.prize-card h2 {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 600;
}
.prize-card .prize-name {
  margin: 6px 0 10px;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.prize-card .sub {
  font-size: 14px;
}
.prize-card .btn {
  margin-top: 22px;
}
.award-pop {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 84px);
  z-index: 870;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 9px 18px 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  background: var(--paper);
  box-shadow: var(--shadow);
  animation: award 2.4s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}
.award-pop b {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.award-pop span {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
@keyframes award {
  0% {
    opacity: 0;
    transform: translate(-50%, 24px) scale(0.9);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -6px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -40px) scale(0.92);
  }
}

/* ---------- 计数胶囊（数喜钱 / 充能） ---------- */
.count-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  line-height: 38px;
  font-size: 13px;
  color: var(--muted);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.count-pill b {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- 数喜钱 ---------- */
.money-area {
  flex: 1;
  min-height: 300px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  touch-action: none;
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}
.money-stack {
  position: relative;
  width: min(78 * var(--vw), 320px);
  height: min(39 * var(--vw), 160px);
  margin-top: -36px;
}
.note {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  border-radius: 20px;
  background: url(../img/note.webp) center / 100% 100% no-repeat;
  box-shadow: 0 8px 14px rgba(122, 62, 38, 0.22);
}
/* 红包和欠条：同样的厚边纸片，换底色和中间的图 */
.note.gold,
.note.iou {
  display: grid;
  place-items: center;
  background: #f7c748;
  box-shadow:
    inset 0 0 0 8px #f7c748,
    inset 0 0 0 13px #fff3d6,
    0 8px 14px rgba(122, 62, 38, 0.22);
}
.note.iou {
  background: #efe3d2;
  box-shadow:
    inset 0 0 0 8px #efe3d2,
    inset 0 0 0 11px #cdb9a2,
    0 8px 14px rgba(122, 62, 38, 0.22);
}
.note i {
  font-style: normal;
  font-size: min(21 * var(--vw), 88px);
  line-height: 1;
}
.note i .art {
  display: block;
  width: 1em;
  height: 1em;
}
.note em {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: #a33a1f;
}
.note em:last-child {
  left: auto;
  right: 30px;
}
.note.iou em {
  color: #7a5c4c;
}
.money-stack .note:nth-child(1) {
  transform: translate(8px, 14px) rotate(2.5deg);
}
.money-stack .note:nth-child(2) {
  transform: translate(4px, 7px) rotate(-1.2deg);
}
.money-fly {
  animation: money-fly 0.45s ease-out forwards;
}
@keyframes money-fly {
  to {
    transform: translateY(calc(-70 * var(--vh))) rotate(var(--r, 8deg)) scale(0.85);
    opacity: 0;
  }
}
.swipe-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  pointer-events: none;
}
.swipe-hint svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
  animation: swipe-up 1.3s ease-in-out infinite;
}
@keyframes swipe-up {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-14px);
  }
}

/* ---------- 接喜糖 ---------- */
.candy-area {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  touch-action: none;
  background: linear-gradient(180deg, #d9f0de, #f3f6dc);
  box-shadow: var(--shadow);
}
.candy-area canvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.candy-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.candy-score {
  display: inline-block;
  min-width: 58px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 36px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.candy-tip {
  margin-top: 10px;
}

/* ---------- 闪电反应 ---------- */
.reflex-pad {
  flex: 1;
  min-height: 300px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border-radius: 36px;
  text-align: center;
  touch-action: none;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.reflex-pad .round {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
}
.reflex-pad .msg {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
}
.reflex-pad .hint {
  font-size: 15px;
  color: var(--muted);
}
.reflex-pad .watch {
  position: relative;
  width: 150px;
  height: 150px;
  margin-bottom: 34px;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 150px;
  line-height: 1;
}
.reflex-pad .watch::before,
.reflex-pad .watch::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 50%;
  border: 5px solid #f7c7b6;
  animation: ripple 2.4s ease-out infinite;
}
.reflex-pad .watch::after {
  animation-delay: 1.2s;
}
@keyframes ripple {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}
.reflex-pad .heart {
  width: 132px;
  height: 122px;
  fill: var(--on-accent);
  filter: none;
}
/* 变色必须瞬间完成：不加过渡，否则影响反应计时 */
.reflex-pad.go {
  color: var(--on-accent);
  background: var(--grad);
  box-shadow: 0 14px 28px rgba(160, 40, 60, 0.28), var(--clay);
}
.reflex-pad.go .msg {
  font-size: 34px;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
}
.reflex-pad .ms {
  font-size: 76px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reflex-pad .ms small {
  margin-left: 4px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}
.reflex-pad.done .msg {
  font-size: 20px;
  color: var(--accent);
}
.reflex-pad.foul {
  background: var(--paper-soft);
}
.reflex-pad.foul .msg {
  color: var(--ink-2);
}
.reflex-pad .mark {
  margin-bottom: 6px;
}

/* ---------- 估一估 ---------- */
.guess-field {
  position: relative;
}
.guess-input {
  display: block;
  width: 100%;
  height: 72px;
  padding: 0 64px;
  border-radius: 24px;
  text-align: center;
  font: 700 34px/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: textfield;
  transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.guess-input::-webkit-outer-spin-button,
.guess-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.guess-input::placeholder {
  font-size: 18px;
  font-weight: 500;
  color: var(--faint);
}
.guess-input:focus {
  background: var(--paper-hi);
  border-color: rgba(217, 64, 90, 0.4);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-sm);
}
.unit-tag {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}

/* ---------- 猜拳 ---------- */
.rps-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 18px 0 8px;
  text-align: center;
}
.hands {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}
.hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 148px;
  padding: 0;
  border-radius: 28px;
  font-size: 70px;
  line-height: 1;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1), background 0.2s, box-shadow 0.2s;
}
.hand span {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}
.hand:active {
  transform: scale(0.95);
}
.hand.on {
  background: var(--paper-hi);
  box-shadow: 0 0 0 4px var(--accent), var(--shadow);
  transform: translateY(-4px);
}
.hand.on span {
  color: var(--ink);
}
.rps-wrap .rps-head {
  margin-top: auto;
}
.rps-wrap .tip {
  margin: 6px 0 auto;
  padding-bottom: calc(8 * var(--vh));
}

/* ---------- 为爱充能 ---------- */
.charge-play {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
}
.charge-head {
  text-align: center;
}
.charge-head .eyebrow {
  font-size: 14px;
}
.charge-head .title {
  margin-top: 4px;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}
.charge-head .title [data-ends] {
  display: inline-block;
  min-width: 1.2em;
}
.energy {
  padding: 0 4px;
}
.progress {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--field);
  box-shadow: inset 0 2px 4px rgba(122, 62, 38, 0.16);
}
.progress i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  /* 用 util.js 的 fillBar() 改：平移，不改宽度（改宽度的过渡每帧都要重排） */
  transform: translateX(-101%);
  transition: transform 0.3s ease-out;
  box-shadow: inset 0 -3px 4px rgba(110, 12, 40, 0.2), inset 0 2px 2px rgba(255, 255, 255, 0.35);
}
.bar-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.bar-meta .pct {
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.charge-heart {
  --size: min(236px, 62 * var(--vw), 34 * var(--vh));
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  margin: 18px auto;
  padding: 0;
  border: 0;
  border-radius: 44%;
  display: grid;
  place-items: center;
  touch-action: none;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transition: transform 0.08s ease-out;
}
.charge-heart::before,
.charge-heart::after {
  content: '';
  position: absolute;
  top: -18px;
  right: -18px;
  bottom: -18px;
  left: -18px;
  border-radius: 50%;
  pointer-events: none;
}
.charge-heart::before {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-color: rgba(217, 64, 90, 0.3);
  animation: ripple 2.2s ease-out infinite;
}
.charge-heart svg {
  width: 46%;
  height: 43%;
  margin-top: -10%;
  filter: drop-shadow(0 6px 8px rgba(160, 40, 60, 0.25));
  animation: heartbeat 1.1s ease-in-out infinite;
}
.charge-heart .lbl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 21%;
  padding-left: 0.32em;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--accent-deep);
}
.charge-heart.hit {
  transform: scale(0.94);
}
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.1);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.06);
  }
}
.my-tally {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.my-tally b {
  display: block;
  margin-bottom: 2px;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.reward-tag {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.reward-tag b {
  color: var(--ink-2);
  font-weight: 600;
}
.reward-card {
  width: 100%;
  padding: 22px 20px;
  border-radius: 24px;
  text-align: center;
}
.reward-card .label {
  margin-bottom: 8px;
}
.reward-card .reward-text {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

/* ---------- 心动 5.20 秒 ---------- */
.tm-target {
  text-align: center;
  padding-top: 6px;
}
.tm-target .label {
  font-size: 15px;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  color: var(--accent-deep);
}
.tm-target b {
  font-size: 64px;
  font-weight: 700;
  line-height: 1.15;
}
.tm-target small {
  margin-left: 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
}
.tm-pad {
  flex: 1;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 36px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  touch-action: none;
}
.tm-pad .tm-num {
  width: 100%;
  height: 1em;
  contain: strict;
  font-size: 92px;
  font-weight: 700;
  line-height: 1;
}
.tm-pad .tm-lbl {
  font-size: 19px;
  font-weight: 600;
  color: var(--accent);
}
.tm-pad.run {
  background: var(--paper-hi);
}
.tm-pad.run.blind {
  color: var(--on-accent);
  background: var(--grad);
  box-shadow: 0 14px 28px rgba(160, 40, 60, 0.28), var(--clay);
}
.tm-pad.run.blind .tm-num {
  animation: heartbeat 1.3s ease-in-out infinite;
}
.tm-pad.run.blind .tm-lbl {
  color: var(--on-accent);
}
.tm-pad.done .tm-lbl {
  color: var(--ink-2);
}
.tm-pad.done.good .tm-num {
  color: var(--accent);
}

/* ---------- 一笔画心 ---------- */
.dw-area {
  flex: 1;
  min-height: 260px;
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  touch-action: none;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.dw-area canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.dw-area canvas.fade {
  opacity: 0.18;
  transition: opacity 0.9s 0.5s linear;
}
.dw-hint,
.dw-score {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
}
.dw-hint {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-2);
}
.dw-hint .art {
  width: 92px;
  height: 92px;
}
.dw-hint small {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.dw-score {
  gap: 2px;
  animation: gain-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.dw-score b {
  font-size: 84px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
}
.dw-score span {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-2);
}
.heart-line polyline {
  stroke: var(--accent);
  stroke-width: 5;
}
.dw-mine {
  display: block;
  width: 110px;
  height: 110px;
  margin: 2px auto 8px;
}
.dw-mine svg {
  width: 100%;
  height: 100%;
}

/* ---------- 火眼金睛 ---------- */
.sp-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-grid {
  display: grid;
  gap: 8px;
  touch-action: none;
}
.sp-grid.s5,
.sp-grid.s6,
.sp-grid.s7 {
  gap: 5px;
}
.sp-grid i {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-radius: 18%;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.sp-grid.locked i {
  opacity: 0.4;
}
.sp-grid i.wrong {
  opacity: 1;
  color: var(--on-accent);
  background: var(--bad);
  border-color: transparent;
  animation: shake 0.25s 2;
}

/* ---------- 一二三木头人 ---------- */
.st-prog i {
  transition-duration: 0.12s;
}
.st-pad {
  position: relative;
  flex: 1;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 36px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  touch-action: none;
}
.st-syl {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}
.st-syl i {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-size: 25px;
  font-weight: 700;
  color: var(--faint);
  background: var(--field);
}
.st-syl i.on {
  color: var(--on-accent);
  background: var(--grad);
}
.st-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
}
.st-main .ico {
  color: var(--accent);
}
.st-sub {
  font-size: 16px;
  color: var(--muted);
}
.st-pad.run {
  box-shadow: 0 0 0 4px #8cc27c, var(--shadow);
}
.st-pad.run .st-main {
  color: var(--ok);
}
.st-pad.run:active,
.st-pad.run.odd {
  background: var(--paper-hi);
}
/* 转身必须瞬间变色，不加过渡 */
.st-pad.freeze {
  color: var(--on-accent);
  background: #5b3a30;
  box-shadow: 0 10px 24px rgba(74, 42, 34, 0.35), inset 0 -8px 14px rgba(0, 0, 0, 0.2), inset 0 4px 6px rgba(255, 255, 255, 0.1);
}
.st-pad.freeze .st-sub,
.st-pad.caught .st-sub {
  color: rgba(255, 255, 255, 0.75);
}
.st-pad.caught {
  color: var(--on-accent);
  background: linear-gradient(180deg, #e9596c, #cf3650);
}
.st-pad.caught .st-main {
  font-size: 40px;
}
.st-pad.caught .st-syl i.on,
.st-pad.freeze .st-syl i.on {
  background: rgba(255, 246, 230, 0.2);
}
.st-pad.arrived .st-syl {
  display: none;
}

/* ---------- 擦亮幸福 ---------- */
.ph-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.ph-tile {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--paper-hi);
  box-shadow: 0 0 0 6px var(--paper-hi), var(--shadow);
  animation: card-in 0.4s cubic-bezier(0.2, 1, 0.3, 1) both;
}
.ph-tile canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
/* 往外多盖 1px：不然边缘会透出一线照片 */
.ph-tile .ph-fog {
  top: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transition: opacity 0.3s;
}
.ph-tile.done {
  box-shadow: 0 0 0 6px var(--accent), var(--shadow-lg);
}
.ph-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: -14px;
  text-align: center;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-2);
  pointer-events: none;
}

/* ---------- 击鼓传花 ---------- */
.fl-pad {
  position: relative;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 36px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  touch-action: none;
}
.fl-drum {
  margin-bottom: 10px;
  font-size: 150px;
  line-height: 1;
}
.fl-drum i {
  display: block;
  animation: pulse 0.5s ease-in-out infinite;
}
.fl-drum .art,
.fl-flower .art,
.fl-go .art {
  display: block;
  width: 1em;
  height: 1em;
}
.fl-flower {
  display: none;
  font-size: 170px;
  line-height: 1;
}
.fl-main {
  font-size: 28px;
  font-weight: 700;
}
.fl-sub {
  font-size: 16px;
  color: var(--muted);
}
.fl-bar {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 246, 230, 0.35);
  visibility: hidden;
}
.fl-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--paper-hi);
  transform-origin: 0 50%;
}
@keyframes fl-bar {
  to {
    transform: scaleX(0);
  }
}
.fl-pad.on {
  color: var(--on-accent);
  background: linear-gradient(180deg, #f28a94, #e2637a);
  box-shadow: 0 14px 28px rgba(160, 40, 60, 0.28), var(--clay);
}
.fl-pad.on .fl-drum {
  display: none;
}
.fl-pad.on .fl-flower {
  display: block;
  animation: gain-in 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.fl-pad.on .fl-main {
  font-size: 34px;
}
.fl-pad.on .fl-sub {
  font-size: 19px;
  font-weight: 600;
  color: var(--on-accent);
}
.fl-pad.on .fl-bar {
  visibility: visible;
}

/* ---------- 抽奖 ---------- */
.roll-mark {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
}
.roll-mark::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 50%;
  border: 2px solid rgba(217, 64, 90, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.roll-mark .itile {
  width: 76px;
  height: 76px;
}

/* ---------- 总榜 ---------- */
.board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.my-rank {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 30px;
  animation: card-in 0.5s cubic-bezier(0.2, 1, 0.3, 1) both;
}
.my-rank .mark {
  margin: 0;
}
.my-rank .mark .itile {
  width: 56px;
  height: 56px;
}
.my-rank-text {
  flex: 1;
  min-width: 0;
}
.my-rank-text .title {
  margin-top: 2px;
  font-size: 24px;
}
.my-rank-text .title small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.my-rank-score {
  text-align: right;
}
.my-rank-score b {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.my-rank-score small {
  font-size: 12px;
  color: var(--muted);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
}
.section-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.section-head span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.player .rank-list li {
  min-height: 52px;
  animation: fade-up 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.player .rank-list .vl small {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.player .rank-list li.me {
  background: var(--paper-hi);
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-sm);
}
.player .rank-list li:nth-child(2) {
  animation-delay: 0.04s;
}
.player .rank-list li:nth-child(3) {
  animation-delay: 0.08s;
}
.player .rank-list li:nth-child(4) {
  animation-delay: 0.12s;
}
.player .rank-list li:nth-child(5) {
  animation-delay: 0.16s;
}
.player .rank-list li:nth-child(n + 6) {
  animation-delay: 0.2s;
}

/* ---------- 小屏 ---------- */
@media (max-height: 800px) {
  #join .join-hero {
    padding: 14px 8px 2px;
  }
  .join-hero .eyebrow {
    margin-bottom: 6px;
  }
  .join-hero .hero-sub {
    margin-top: 6px;
  }
}
@media (max-height: 700px) {
  .hero {
    padding-top: 16px;
  }
  .intro {
    gap: 14px;
  }
  .rules li {
    padding: 9px 0;
    font-size: 14px;
  }
  .count-ring {
    width: 170px;
    height: 170px;
  }
  .count-big {
    font-size: 92px;
  }
  .opts.duo .opt {
    min-height: 140px;
  }
  .my-tally b {
    font-size: 36px;
  }
}
@media (max-width: 360px) {
  body.player {
    --gutter: 14px;
  }
  .avatar-pick {
    gap: 5px;
  }
  .q-text {
    font-size: 19px;
    padding: 18px;
  }
  .hand {
    height: 112px;
    font-size: 42px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage-box,
  .charge-heart svg,
  .charge-heart::before,
  .reflex-pad .watch::before,
  .reflex-pad .watch::after,
  .wait-pill::after {
    animation: none;
  }
}

/* ---------- 卡片后面探头的一群人 ---------- */
/* 卡片只盖住最底下一条，爪子正好搭在卡片边上；按宽度算，什么尺寸都不会切到脸 */
.peek-crew {
  --crew-w: min(300px, 78%);
  flex: none;
  align-self: center;
  width: var(--crew-w);
  aspect-ratio: 1200 / 429;
  margin: 0 auto calc(var(--crew-w) * -0.02);
  background: url(../img/s/crew.webp) center bottom / contain no-repeat;
}
/* 名字中间的小红心：手机上二十几像素，用小图 */
.player .amp {
  background-image: url(../img/s/art/heart.webp);
}
#join .peek-crew {
  --crew-w: min(270px, 72%);
  animation: fade-up 0.6s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* 大厅是带 18px 间距的 flex，把间距抵掉 */
.lobby .peek-crew {
  margin-bottom: calc(var(--crew-w) * -0.02 - 18px);
}
.peek-crew + .clay {
  position: relative;
}
.game-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.game-title .itile {
  width: 1.5em;
  height: 1.5em;
  margin: 0;
}

.lobby.no-bless .peek-crew {
  display: none;
}

/* 矮屏：大厅一屏放下 */
@media (max-height: 700px) {
  .lobby {
    gap: 12px;
  }
  .lobby .hero {
    padding: 4px 8px 0;
  }
  .lobby .hero .eyebrow {
    display: none;
  }
  .lobby .peek-crew {
    width: 200px;
    margin-bottom: -26px;
  }
  .lobby .panel {
    padding: 14px;
  }
  .lobby .bless-card {
    gap: 10px;
  }
  .lobby .foot-tip {
    padding-top: 0;
  }
}
