/* =========================================================================
   软糯黏土 · 设计基础（大屏 / 宾客手机 / 司仪台共用）
   和宾客头像同一画风：整块实色、圆滚滚的厚轮廓、哑光的软边立体感。
   背景是主题色（theme.css），卡片是奶油纸，文字是可可色，按钮是珊瑚红。
   不用毛玻璃、渐变字、细线条、亮面高光；要画东西先找 img/art、img/icon 里的图。
   ========================================================================= */
:root {
  --font: 'WG Round', ui-rounded, 'Yuanti SC', 'YouYuan', 'HarmonyOS Sans SC', 'MiSans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans CJK SC',
    sans-serif;

  /* 文字：可可色 */
  --ink: #4a2a22;
  --ink-2: rgba(74, 42, 34, 0.84);
  --muted: rgba(74, 42, 34, 0.66);
  --faint: rgba(74, 42, 34, 0.4);
  --on-accent: #fff8ec;

  /* 点缀：珊瑚红 */
  --accent: #d9405a;
  --accent-deep: #b52c48;
  --accent-soft: rgba(217, 64, 90, 0.14);
  --grad: linear-gradient(180deg, #e9596c, #d9405a);

  /* 材质：奶油纸 */
  --paper-hi: #fffdf7;
  --paper: #fff8ec;
  --paper-soft: #fff0dc;
  --hair: rgba(122, 62, 38, 0.13);
  --field: #ffedd6;
  --edge: rgba(122, 62, 38, 0.1);

  /* 软边：外面一圈淡影，里面上亮下暗，像捏出来的 */
  --shadow-sm: 0 2px 6px rgba(122, 62, 38, 0.12), inset 0 -3px 5px rgba(122, 62, 38, 0.08), inset 0 2px 3px rgba(255, 255, 255, 0.8);
  --shadow: 0 8px 20px rgba(122, 62, 38, 0.14), inset 0 -4px 8px rgba(122, 62, 38, 0.08), inset 0 3px 4px rgba(255, 255, 255, 0.85);
  --shadow-lg: 0 16px 40px rgba(122, 62, 38, 0.2), inset 0 -5px 10px rgba(122, 62, 38, 0.08), inset 0 3px 5px rgba(255, 255, 255, 0.85);
  --clay: inset 0 -4px 7px rgba(110, 12, 40, 0.24), inset 0 3px 5px rgba(255, 255, 255, 0.32);
  --radius: 24px;

  /* 状态 */
  --ok: #5ea04e;
  --bad: #de4747;
  --warn: #ee9b33;
  --gold: #f5bd3d;

  /* 亲友身份（只用来给名字上一点颜色，不做对抗） */
  --groom: #5b86c9;
  --bride: #e2708f;

  /* 名次 */
  --medal-1: linear-gradient(180deg, #fbd66e, #f2b632);
  --medal-2: linear-gradient(180deg, #e3e6ec, #c3c9d4);
  --medal-3: linear-gradient(180deg, #f0b48a, #dc9060);
}
body.screen {
  --shadow-sm: 0 4px 12px rgba(122, 62, 38, 0.12), inset 0 -5px 9px rgba(122, 62, 38, 0.08), inset 0 4px 5px rgba(255, 255, 255, 0.8);
  --shadow: 0 14px 34px rgba(122, 62, 38, 0.15), inset 0 -8px 16px rgba(122, 62, 38, 0.08), inset 0 5px 7px rgba(255, 255, 255, 0.85);
  --shadow-lg: 0 26px 64px rgba(122, 62, 38, 0.2), inset 0 -10px 20px rgba(122, 62, 38, 0.09), inset 0 6px 9px rgba(255, 255, 255, 0.85);
  --clay: inset 0 -8px 14px rgba(110, 12, 40, 0.24), inset 0 6px 9px rgba(255, 255, 255, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button,
input {
  border: 0;
  font-family: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.side-groom {
  --side: var(--groom);
}
.side-bride {
  --side: var(--bride);
}

/* ---------- 背景：主题色 + 软软的云和小山 ---------- */
.mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}
.mesh::before,
.mesh::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
}
/* 云 */
.mesh::before {
  top: 0;
  height: 46%;
  --c: var(--puff) 98.5%, transparent 100%;
  background:
    radial-gradient(circle closest-side, var(--c)) 4% 36% / 11vmax 11vmax no-repeat,
    radial-gradient(circle closest-side, var(--c)) 11% 30% / 15vmax 15vmax no-repeat,
    radial-gradient(circle closest-side, var(--c)) 18% 40% / 10vmax 10vmax no-repeat,
    radial-gradient(circle closest-side, var(--c)) 92% 14% / 9vmax 9vmax no-repeat,
    radial-gradient(circle closest-side, var(--c)) 98% 8% / 13vmax 13vmax no-repeat;
}
/* 山：边缘亮一圈，像头像里的软边 */
.mesh::after {
  top: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 46% 23.4% at 88% 103.6%, var(--hill-2) 72%, var(--hill-2-hi) 98.8%, transparent 100%),
    radial-gradient(ellipse 58% 19.2% at 26% 104.8%, var(--hill-2) 70%, var(--hill-2-hi) 98.8%, transparent 100%),
    radial-gradient(ellipse 50% 27.6% at 58% 103.6%, var(--hill-1) 72%, var(--hill-1-hi) 98.8%, transparent 100%),
    radial-gradient(ellipse 40% 25.2% at 0% 102.4%, var(--hill-1) 72%, var(--hill-1-hi) 98.8%, transparent 100%);
}

/* ---------- 奶油纸卡片 ---------- */
.clay {
  background: var(--paper);
  box-shadow: var(--shadow);
}

/* ---------- 文字工具 ---------- */
.eyebrow {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
}
.muted {
  color: var(--muted);
}
.num {
  font-variant-numeric: tabular-nums;
}
.grad-text {
  color: var(--accent);
}
/* 新人名字：中间的 & 换成一颗心 */
.amp {
  display: inline-block;
  width: 0.82em;
  height: 0.82em;
  margin: 0 0.16em;
  vertical-align: -0.1em;
  font-size: 1em;
  color: transparent;
  background: url(../img/art/heart.webp) center / contain no-repeat;
}

/* ---------- 道具图（js/art.js） ---------- */
.art {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.32em;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.art.disc {
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- 图标块 ---------- */
.itile {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 30%;
  overflow: hidden;
  color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0.06em 0.3em rgba(122, 62, 38, 0.18);
}
.itile > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.itile.pic {
  overflow: visible;
  background: none;
  box-shadow: none;
}
.itile.pic > img {
  object-fit: contain;
}
.itile svg {
  width: 52%;
  height: 52%;
}
.ico {
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  flex: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 99px;
  font: 700 17px var(--font);
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, opacity 0.2s, box-shadow 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.btn-primary,
.btn-accent {
  color: var(--on-accent);
  background: var(--grad);
  box-shadow: 0 8px 18px rgba(160, 40, 60, 0.28), var(--clay);
}
.btn-primary:active,
.btn-accent:active {
  box-shadow: 0 3px 8px rgba(160, 40, 60, 0.28), var(--clay);
}

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  background: rgba(74, 42, 34, 0.82);
  color: var(--on-accent);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  animation: toast-in 0.25s ease-out;
  transition: opacity 0.4s, transform 0.4s;
  white-space: nowrap;
}
.toast-item.out {
  opacity: 0;
  transform: translateY(-10px);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
}

.conn-badge {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 999;
  font-size: 13px;
  padding: 0;
  border-radius: 999px;
  color: var(--on-accent);
  background: rgba(74, 42, 34, 0.85);
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
.conn-badge.bad {
  opacity: 1;
  padding: 7px 14px;
}

/* ---------- 排行榜 ---------- */
.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rank-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.rank-list .rk {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: rgba(74, 42, 34, 0.05);
  flex: none;
}
.rank-list .rk-1 {
  background: var(--medal-1);
  color: #6b4410;
}
.rank-list .rk-2 {
  background: var(--medal-2);
  color: #4a4d55;
}
.rank-list .rk-3 {
  background: var(--medal-3);
  color: #6b3212;
}
.rank-list .av {
  font-size: 22px;
  flex: none;
}
.rank-list .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.rank-list .nm::after {
  /* 亲友身份：名字后一个小圆点 */
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--side, transparent);
  opacity: 0.7;
}
.rank-list .vl {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- 领奖台 ---------- */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}
.pod {
  flex: 1;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: pod-in 0.6s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}
.pod-1 {
  animation-delay: 0.5s;
}
.pod-2 {
  animation-delay: 0.25s;
}
.pod-av {
  font-size: 40px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper-hi);
  box-shadow: 0 0 0 4px var(--paper-hi), 0 0 0 7px var(--side, var(--accent)), 0 10px 22px rgba(122, 62, 38, 0.2);
}
.pod-name {
  margin-top: 12px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pod-val {
  font-weight: 600;
  color: var(--accent);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pod-block {
  margin-top: 10px;
  width: 100%;
  border-radius: 22px 22px 6px 6px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: start center;
  padding-top: 10px;
  font-size: 26px;
  font-weight: 700;
  color: var(--muted);
}
.pod-block span {
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
}
.pod-1 .pod-block span {
  background: var(--medal-1);
  color: #6b4410;
}
.pod-2 .pod-block span {
  background: var(--medal-2);
  color: #4a4d55;
}
.pod-3 .pod-block span {
  background: var(--medal-3);
  color: #6b3212;
}
.pod-1 .pod-block {
  height: 120px;
}
.pod-2 .pod-block {
  height: 86px;
}
.pod-3 .pod-block {
  height: 64px;
}
.pod-1 .pod-av {
  width: 88px;
  height: 88px;
  font-size: 50px;
}

/* ---------- 动画 ---------- */
@keyframes pod-in {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.85);
  }
}
@keyframes pulse {
  50% {
    transform: scale(1.05);
  }
}
@keyframes float {
  50% {
    transform: translateY(-8px);
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px) rotate(-1deg);
  }
  75% {
    transform: translateX(4px) rotate(1deg);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 宾客头像（js/faces.js） ---------- */
/* 默认跟着文字走：名字前面的小圆头像 */
.face {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.3em;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* 放在圆片里时铺满 */
.pod-av > .face,
.me-av > .face,
.avatar-pick .face,
.join-chip .av > .face,
.dm .av > .face,
.say-pill .av > .face,
.bar-row .av > .face,
.lot-card .av > .face,
.chip-av i > .face,
.col-av > .face,
.who-row i > .face,
.crowd i > .face,
.gl-dots i > .face,
.rx-dots i > .face,
.tm-dot > .face,
.fl-seat span > .face,
.ph-pops span > .face,
.st-run span > .face,
.h-board .av > .face,
.h-winners .av > .face,
.h-player .av > .face {
  display: block;
  width: 100%;
  height: 100%;
}
.h-board .av > .face,
.h-winners .av > .face,
.h-player .av > .face {
  height: auto;
  aspect-ratio: 1;
}

/* 新郎新娘 */
.face.duo {
  box-shadow: 0 0 0 0.05em var(--paper-hi), 0 0.06em 0.16em rgba(122, 62, 38, 0.2);
}
.pv-opt .emo > .duo {
  display: block;
  width: 100%;
  height: 100%;
  box-shadow: none;
}
.pad-who > .duo,
.pad-card .b i > .duo {
  display: block;
  width: 1.1em;
  height: 1.1em;
}
.pad-card .b i > .duo {
  margin-bottom: 0.08em;
  box-shadow: none;
}
.walk i > .duo,
.meet i > .duo {
  display: block;
  width: 1em;
  height: 1em;
}
.cg-walk i > .duo {
  display: block;
  width: 27px;
  height: 27px;
}
.cg-walk .f > .duo {
  margin-left: auto;
}
/* 规则页小演示里的头像 */
.demo .face {
  box-shadow: none;
}
.dp-pair s > .duo,
.dp-pair em > .duo,
.dg-line i > .face,
.dt-track i > .face {
  display: block;
  width: 1.2em;
  height: 1.2em;
}
.dp-pair s > .duo,
.dp-pair em > .duo {
  width: 1.5em;
  height: 1.5em;
}

/* ---------- 见好就收的气球、戒指在哪的杯子（手机、大屏、玩法演示共用） ---------- */
.bl-ball svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.b-body {
  fill: #f7636a;
}
.b-knot {
  fill: #fbd9ae;
}
.b-cheek {
  fill: #fda697;
}
.b-face {
  fill: #5a2513;
  stroke: #5a2513;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.b-face circle,
.b-face ellipse {
  stroke: none;
}
.cups {
  position: relative;
}
.cups::before {
  content: '';
  display: block;
  padding-top: 54%;
}
.cups.n4::before {
  padding-top: 44%;
}
.cups .cup,
.cups .cp-ring {
  position: absolute;
  left: 0;
  bottom: 9%;
  width: 33.3333%;
  padding: 0;
  border: 0;
  background: none;
}
.cups.n4 .cup,
.cups.n4 .cp-ring {
  width: 25%;
}
.cups .cup span {
  display: block;
  width: 92%;
  margin: 0 auto;
  transition: transform 0.32s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.cups .cup span.up {
  transform: translateY(-46%);
}
.cups .cup svg {
  display: block;
  width: 100%;
}
.cups .cp-ring {
  display: block;
  font-style: normal;
}
.cups .cp-ring .art {
  display: block;
  width: 46%;
  height: auto;
  margin: 0 auto;
}
.c-body {
  fill: #ef5568;
}
.c-band {
  fill: #fde3c4;
}
.c-heart {
  fill: #fde3c4;
}
.c-shade {
  fill: #b52c48;
  opacity: 0.16;
}
