/* ============================================================
   dice-adventure.css — Dice Adventure 骰子大冒险 v2
   S 形路线 / 圆形站点 / 双棋子 / 双人玩家卡 / 开局面板
   复用 game-common.css 的配色、顶栏、按钮、toast
   ============================================================ */

/* ---------- 页面骨架 ---------- */
.dice-wrap{max-width:1180px;}

.game{
  margin-top:16px;
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(320px,.72fr);
  gap:18px;
  align-items:start;
}

/* ---------- 路线卡片 ---------- */
.route-wrap{
  padding:14px;
  border-radius:30px;
  border:2px solid rgba(199,91,31,.14);
  background:linear-gradient(180deg,#fff 0%,#FFFDF8 100%);
  box-shadow:var(--shadow),0 4px 0 #F6DFC8,inset 0 1px 0 #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
}

.route-board{
  --route-ar:1.6129;
  --route-h:calc(100dvh - 340px);
  position:relative;
  width:min(100%,calc(var(--route-h) * var(--route-ar)));
  aspect-ratio:var(--route-ar);
  border-radius:24px;
  overflow:hidden;
  background:
    radial-gradient(circle at 18% 12%,rgba(255,201,74,.20),transparent 34%),
    radial-gradient(circle at 86% 82%,rgba(126,208,232,.18),transparent 38%),
    linear-gradient(160deg,#FFFDF8,#FFF6E9);
  border:1.5px solid rgba(199,91,31,.08);
  touch-action:manipulation;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}

.route-svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:visible;
  pointer-events:none;
}
.route-path-shadow{
  fill:none;
  stroke:#E4C7A8;
  stroke-width:30;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.route-path{
  fill:none;
  stroke:#FFF9F0;
  stroke-width:22;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.route-dash{
  fill:none;
  stroke:#E8B98D;
  stroke-width:3.6;
  stroke-dasharray:2 15;
  stroke-linecap:round;
}

/* ---------- 圆形站点 ---------- */
.route-nodes{position:absolute;inset:0;pointer-events:none;}

.stop{
  position:absolute;
  transform:translate(-50%,-50%);
  width:clamp(34px,6.8%,64px);
  aspect-ratio:1 / 1;
  border-radius:50%;
  display:grid;
  place-items:center;
  text-align:center;
  background:linear-gradient(160deg,#fff 0%,#FFF3E4 100%);
  border:3px solid #E8C9A8;
  box-shadow:0 4px 0 #E8C9A8,0 8px 16px rgba(74,44,26,.12),inset 0 2px 0 #fff;
  color:#8A4B1D;
  font-weight:900;
  line-height:1;
  transition:transform .2s ease,box-shadow .2s ease,opacity .2s ease,background .2s ease;
}
.stop-face{
  font-size:clamp(.85rem,2.1vw,1.5rem);
  line-height:1;
  letter-spacing:-.5px;
}
.stop-no{
  position:absolute;
  right:-3px;
  bottom:-3px;
  min-width:18px;
  height:18px;
  padding:0 4px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#fff;
  border:1.5px solid #E8C9A8;
  color:#8A4B1D;
  font-size:9px;
  font-weight:900;
  line-height:1;
}

.stop-start{background:linear-gradient(160deg,#E9FBF5,#CFF3E8);border-color:#8ED8C8;box-shadow:0 4px 0 #8ED8C8,0 8px 16px rgba(27,143,130,.14),inset 0 2px 0 #fff;color:#126B62;}
.stop-start .stop-face{font-size:clamp(.7rem,1.6vw,1.05rem);letter-spacing:.5px;}
.stop-task{background:linear-gradient(160deg,#fff 0%,#FFF0DE 100%);}
.stop-bonus{background:linear-gradient(160deg,#FFFBE0,#FFEFAF);border-color:#E8C45C;box-shadow:0 4px 0 #E8C45C,0 8px 16px rgba(138,106,0,.14),inset 0 2px 0 #fff;color:#8A6A00;}
.stop-bonus .stop-face{font-size:clamp(1rem,2.5vw,1.75rem);}
.stop-finish{background:linear-gradient(160deg,#FFF6D0,#FFE28A);border-color:#E0B53F;box-shadow:0 4px 0 #E0B53F,0 10px 20px rgba(169,74,21,.18),inset 0 2px 0 #fff;color:#A94A15;}
.stop-finish .stop-face{font-size:clamp(1.1rem,2.8vw,1.95rem);}

.stop.is-passed{opacity:.58;}
.stop.is-current{
  z-index:3;
  transform:translate(-50%,-50%) scale(1.13);
  box-shadow:0 0 0 5px rgba(242,153,74,.30),0 6px 0 #E8C9A8,0 12px 20px rgba(199,91,31,.16);
  animation:stopPulse 1.5s ease-in-out infinite;
}
@keyframes stopPulse{
  0%,100%{box-shadow:0 0 0 4px rgba(242,153,74,.26),0 6px 0 #E8C9A8,0 12px 20px rgba(199,91,31,.14);}
  50%{box-shadow:0 0 0 9px rgba(242,153,74,.08),0 6px 0 #E8C9A8,0 12px 20px rgba(199,91,31,.14);}
}
.stop.is-finished{
  z-index:4;
  box-shadow:0 0 0 6px rgba(255,201,74,.48),0 6px 0 #E0B53F,0 12px 24px rgba(169,74,21,.22);
}

/* ---------- 双棋子 ---------- */
.route-tokens{position:absolute;inset:0;pointer-events:none;}

.token{
  position:absolute;
  z-index:6;
  transform:translate(-50%,-50%);
  width:clamp(30px,5.6%,54px);
  aspect-ratio:1 / 1;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,#fff,#FFF0DE);
  border:3px solid var(--pri);
  box-shadow:0 4px 0 #C75B1F,0 8px 16px rgba(74,44,26,.22);
  transition:left .23s cubic-bezier(.34,1.4,.64,1),top .23s cubic-bezier(.34,1.4,.64,1),box-shadow .18s ease;
  will-change:left,top;
}
.token[hidden]{display:none;}
.token-face{font-size:clamp(1rem,2.2vw,1.7rem);line-height:1;}
.token-tag{
  position:absolute;
  left:50%;
  bottom:-8px;
  transform:translateX(-50%);
  padding:0 5px;
  border-radius:999px;
  background:var(--pri-d);
  color:#fff;
  font-size:8px;
  font-weight:900;
  letter-spacing:.3px;
  line-height:1.5;
  white-space:nowrap;
}
.token-1{border-color:var(--teal);box-shadow:0 4px 0 #126B62,0 8px 16px rgba(74,44,26,.22);}
.token-1 .token-tag{background:var(--teal);}
.token.is-active{z-index:8;box-shadow:0 0 0 4px rgba(242,153,74,.32),0 4px 0 #C75B1F,0 10px 18px rgba(74,44,26,.24);}
.token-1.is-active{box-shadow:0 0 0 4px rgba(27,143,130,.26),0 4px 0 #126B62,0 10px 18px rgba(74,44,26,.24);}
.token.is-finished{filter:saturate(.8);}
.token.hop{animation:tokenHop .28s cubic-bezier(.34,1.56,.64,1);}
@keyframes tokenHop{
  0%,100%{transform:translate(-50%,-50%) scale(1);}
  45%{transform:translate(-50%,-78%) scale(1.16) rotate(-5deg);}
}

.hop-bubble{
  position:absolute;
  z-index:9;
  left:50%;
  top:50%;
  transform:translate(-50%,-130%);
  padding:2px 9px;
  border-radius:999px;
  background:var(--pri-d);
  color:#fff;
  font-size:clamp(.85rem,1.6vw,1.15rem);
  font-weight:900;
  opacity:0;
  pointer-events:none;
}
.hop-bubble.show{animation:hopFloat .62s ease both;}
@keyframes hopFloat{
  0%{opacity:0;transform:translate(-50%,-100%) scale(.7);}
  25%{opacity:1;transform:translate(-50%,-135%) scale(1.1);}
  100%{opacity:0;transform:translate(-50%,-190%) scale(.95);}
}

/* ---------- 右侧面板 ---------- */
.panel{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:18px;
  border-radius:28px;
  border:2px solid rgba(199,91,31,.14);
  background:linear-gradient(180deg,#fff 0%,#FFFDF8 100%);
  box-shadow:var(--shadow),0 4px 0 #F6DFC8,inset 0 1px 0 #fff;
}
@media (min-width:900px){
  .panel{position:sticky;top:16px;}
}

/* ---------- 玩家卡 ---------- */
.players{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.players.is-single{grid-template-columns:minmax(0,1fr);}

.player-card{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  min-height:56px;
  padding:7px 10px;
  border-radius:16px;
  border:2px solid var(--line);
  background:#fff;
  box-shadow:0 3px 0 #F3DDC7;
  transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease,opacity .16s ease;
}
.player-card[hidden]{display:none;}
.player-card.is-active{
  border-color:var(--pri);
  background:linear-gradient(180deg,#FFF7EC,#FFEBD6);
  box-shadow:0 0 0 3px rgba(242,153,74,.16),0 4px 0 #E8C9A8;
  transform:translateY(-2px);
}
.player-card.is-done{background:linear-gradient(180deg,#FFFBE4,#FFF1B8);border-color:#E8C45C;}
.player-avatar{
  flex:0 0 auto;
  font-size:clamp(1.45rem,2.6vw,2rem);
  line-height:1;
  filter:drop-shadow(0 3px 4px rgba(74,44,26,.16));
}
.player-meta{min-width:0;display:flex;flex-direction:column;gap:1px;}
.player-name{
  font-size:13px;
  font-weight:900;
  color:var(--ink);
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.player-stars{
  font-size:12px;
  font-weight:800;
  color:#8A6A00;
  line-height:1.2;
  white-space:nowrap;
}
.player-stars b{font-size:15px;color:#C75B1F;}
.player-stars b.pop{animation:starPop .45s cubic-bezier(.34,1.56,.64,1);}
@keyframes starPop{
  0%{transform:scale(1);}
  45%{transform:scale(1.5) rotate(-7deg);}
  100%{transform:scale(1);}
}
.turn-badge{
  position:absolute;
  top:-9px;
  right:8px;
  padding:1px 7px;
  border-radius:999px;
  background:var(--teal);
  color:#fff;
  font-size:9px;
  font-weight:900;
  letter-spacing:.4px;
  line-height:1.5;
  opacity:0;
  transform:translateY(4px);
  transition:opacity .16s ease,transform .16s ease;
  white-space:nowrap;
}
.player-card.is-active .turn-badge{opacity:1;transform:none;}
.player-trophy{
  position:absolute;
  top:-11px;
  left:-7px;
  font-size:20px;
  line-height:1;
  filter:drop-shadow(0 3px 4px rgba(169,74,21,.3));
  animation:trophyIn .45s cubic-bezier(.34,1.56,.64,1) both;
}
.player-trophy[hidden]{display:none;}
@keyframes trophyIn{
  0%{transform:scale(.3) rotate(-16deg);opacity:0;}
  100%{transform:none;opacity:1;}
}

/* ---------- 骰子区 ---------- */
.dice-dock{
  display:flex;
  align-items:center;
  gap:14px;
}
.dice{
  flex:0 0 auto;
  width:clamp(76px,9vw,104px);
  aspect-ratio:1 / 1;
  padding:clamp(8px,1vw,12px);
  border-radius:22px;
  border:3px solid #E8C9A8;
  background:linear-gradient(145deg,#fff,#FFF3E4);
  box-shadow:0 8px 0 #E8C9A8,0 14px 24px rgba(199,91,31,.18),inset 0 2px 0 #fff;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
  gap:clamp(2px,.45vw,4px);
}
.dice.is-rolling{animation:diceShake .16s ease-in-out infinite;}
@keyframes diceShake{
  0%,100%{transform:rotate(-4deg) translateY(0);}
  50%{transform:rotate(4deg) translateY(-3px);}
}
.pip{
  width:72%;
  height:72%;
  align-self:center;
  justify-self:center;
  border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#F2994A,#C75B1F);
  opacity:0;
  transform:scale(.35);
  transition:opacity .1s ease,transform .1s ease;
}
.dice[data-face="1"] .pip:nth-child(5),
.dice[data-face="2"] .pip:nth-child(1),
.dice[data-face="2"] .pip:nth-child(9),
.dice[data-face="3"] .pip:nth-child(1),
.dice[data-face="3"] .pip:nth-child(5),
.dice[data-face="3"] .pip:nth-child(9),
.dice[data-face="4"] .pip:nth-child(1),
.dice[data-face="4"] .pip:nth-child(3),
.dice[data-face="4"] .pip:nth-child(7),
.dice[data-face="4"] .pip:nth-child(9),
.dice[data-face="5"] .pip:nth-child(1),
.dice[data-face="5"] .pip:nth-child(3),
.dice[data-face="5"] .pip:nth-child(5),
.dice[data-face="5"] .pip:nth-child(7),
.dice[data-face="5"] .pip:nth-child(9),
.dice[data-face="6"] .pip:nth-child(1),
.dice[data-face="6"] .pip:nth-child(3),
.dice[data-face="6"] .pip:nth-child(4),
.dice[data-face="6"] .pip:nth-child(6),
.dice[data-face="6"] .pip:nth-child(7),
.dice[data-face="6"] .pip:nth-child(9){
  opacity:1;
  transform:none;
}
.dice-side{min-width:0;flex:1 1 auto;display:flex;flex-direction:column;gap:6px;}

.roll-btn{
  width:100%;
  min-height:64px;
  padding:8px 14px;
  border:0;
  border-radius:20px;
  cursor:pointer;
  font-family:inherit;
  color:#fff;
  background:linear-gradient(180deg,#FFB061,var(--pri) 45%,var(--pri-d));
  box-shadow:0 7px 0 #A94A15,0 12px 22px rgba(199,91,31,.26),inset 0 2px 0 rgba(255,255,255,.42);
  transition:transform .12s ease,box-shadow .12s ease,filter .12s ease;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
}
.roll-btn .roll-en{font-size:clamp(1rem,1.8vw,1.25rem);font-weight:900;letter-spacing:.4px;line-height:1.1;}
.roll-btn .roll-zh{font-size:12px;font-weight:700;opacity:.9;line-height:1.2;}
.roll-btn:active:not(:disabled){transform:translateY(4px);box-shadow:0 3px 0 #A94A15,0 6px 12px rgba(199,91,31,.24);}
.roll-btn:disabled{
  cursor:default;
  filter:grayscale(.45);
  opacity:.55;
  box-shadow:0 4px 0 #C9A98C;
}
.roll-btn:focus-visible{outline:3px solid var(--teal);outline-offset:3px;}

.roll-result{
  min-height:1.4em;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:var(--teal);
  line-height:1.4;
}

/* ---------- 等待区 ---------- */
.task-idle{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:180px;
  padding:16px;
  border-radius:22px;
  border:2px dashed var(--line);
  background:linear-gradient(180deg,#FFFDF8,#FFF7EC);
  text-align:center;
}
.task-idle[hidden]{display:none;}
.idle-mascot{font-size:clamp(2.4rem,5vw,3.6rem);line-height:1;animation:idleFloat 2.4s ease-in-out infinite;}
@keyframes idleFloat{
  0%,100%{transform:translateY(0) rotate(-2deg);}
  50%{transform:translateY(-6px) rotate(2deg);}
}
.idle-en{font-size:clamp(1.2rem,2vw,1.6rem);font-weight:900;color:var(--pri-d);}
.idle-zh{font-size:13px;font-weight:700;color:var(--mut);}

/* ---------- 任务卡 ---------- */
.task-card{
  padding:14px;
  border-radius:22px;
  border:2px solid #F3D3B2;
  background:linear-gradient(180deg,#fff,#FFF6E9);
  box-shadow:0 6px 0 #F0D9C2,0 12px 22px rgba(199,91,31,.1);
  display:flex;
  flex-direction:column;
  gap:8px;
  animation:taskIn .36s cubic-bezier(.34,1.4,.64,1) both;
}
.task-card[hidden]{display:none;}
@keyframes taskIn{
  from{opacity:0;transform:translateY(12px) scale(.97);}
  to{opacity:1;transform:none;}
}
.task-top{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.task-badge{
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border-radius:999px;
  background:var(--teal-l);
  border:1px solid rgba(27,143,130,.2);
  color:var(--teal);
  font-size:11px;
  font-weight:900;
  letter-spacing:.5px;
  text-transform:uppercase;
  white-space:nowrap;
}
.task-badge.badge-point{background:var(--pri-l);border-color:rgba(199,91,31,.2);color:var(--pri-d);}
.task-badge.badge-touch{background:#EAF3FF;border-color:rgba(80,140,220,.2);color:#2D6DB5;}
.task-badge.badge-action{background:#F3ECFF;border-color:rgba(120,80,190,.2);color:#6B3FA0;}
.task-badge.badge-life{background:#E8F7F4;border-color:rgba(27,143,130,.2);color:var(--teal);}
.task-badge.badge-lucky{background:#FFF6C9;border-color:#EAD98A;color:#8A6A00;}
.task-cell{font-size:12px;font-weight:800;color:var(--mut);max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.task-art{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  height:clamp(104px,16vh,150px);
}
.task-emoji{font-size:clamp(3rem,6vw,4.2rem);line-height:1;}
.task-emoji[hidden]{display:none;}
.task-svg{height:100%;display:flex;align-items:flex-end;justify-content:center;}
.task-svg[hidden]{display:none;}
.task-svg .art-svg{
  height:100%;
  width:auto;
  max-width:100%;
  overflow:visible;
  filter:drop-shadow(0 8px 10px rgba(199,91,31,.16));
}
.task-svg .art{
  opacity:0;
  transform:scale(.94);
  transform-box:view-box;
  transform-origin:100px 80px;
  transition:opacity .24s ease,transform .24s cubic-bezier(.34,1.4,.64,1);
}
.task-svg .art.is-on{opacity:1;transform:none;}

.task-en{
  font-size:clamp(1.35rem,2.8vw,1.95rem);
  line-height:1.2;
  font-weight:900;
  color:var(--pri-d);
  text-align:center;
  text-wrap:balance;
  overflow-wrap:anywhere;
  text-shadow:0 2px 0 #FFE8CE;
}
.task-en em{
  font-style:normal;
  color:var(--teal);
  text-decoration:underline;
  text-decoration-thickness:.08em;
  text-underline-offset:.12em;
}
.task-zh{font-size:15px;font-weight:800;color:var(--ink);text-align:center;}
.task-tip{
  padding:8px 11px;
  border-radius:13px;
  background:linear-gradient(180deg,var(--teal-l),#DFF4F0);
  border:1px solid rgba(27,143,130,.16);
  color:var(--teal);
  font-size:12px;
  line-height:1.55;
}
body.hide-zh .task-zh,
body.hide-zh .task-tip{display:none;}

.done-btn{
  width:100%;
  min-height:58px;
  border:0;
  border-radius:18px;
  cursor:pointer;
  font-family:inherit;
  color:#fff;
  font-size:clamp(1.05rem,1.8vw,1.3rem);
  font-weight:900;
  letter-spacing:.5px;
  background:linear-gradient(180deg,#38B3A4,var(--teal));
  box-shadow:0 6px 0 #126B62,0 10px 18px rgba(27,143,130,.22),inset 0 2px 0 rgba(255,255,255,.35);
  transition:transform .12s ease,box-shadow .12s ease;
}
.done-btn:active{transform:translateY(3px);box-shadow:0 3px 0 #126B62;}
.done-btn:focus-visible{outline:3px solid var(--pri);outline-offset:3px;}

/* ---------- 开局面板 ---------- */
.start-overlay{
  position:fixed;
  inset:0;
  z-index:90;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(42,26,15,.46);
  backdrop-filter:blur(7px);
}
.start-overlay[hidden]{display:none;}
.start-panel{
  position:relative;
  width:min(560px,100%);
  max-height:calc(100dvh - 32px);
  overflow:auto;
  padding:clamp(20px,3.4vw,30px);
  border-radius:34px;
  border:3px solid #F6C79C;
  background:
    radial-gradient(circle at 12% 0%,rgba(255,201,74,.28),transparent 42%),
    linear-gradient(180deg,#fff,#FFF7EC);
  box-shadow:0 24px 60px rgba(42,26,15,.28),0 8px 0 #E8C9A8;
  text-align:center;
  animation:startIn .4s cubic-bezier(.34,1.4,.64,1) both;
}
@keyframes startIn{
  from{opacity:0;transform:translateY(20px) scale(.96);}
  to{opacity:1;transform:none;}
}
.start-close{
  position:absolute;
  top:10px;
  right:12px;
  width:38px;
  height:38px;
  border:0;
  border-radius:50%;
  cursor:pointer;
  background:#FFF0DE;
  color:var(--pri-d);
  font-size:22px;
  font-weight:900;
  line-height:1;
  box-shadow:0 3px 0 #E8C9A8;
}
.start-close[hidden]{display:none;}
.start-close:active{transform:translateY(2px);box-shadow:none;}
.start-kicker{font-size:12px;font-weight:900;letter-spacing:2px;text-transform:uppercase;color:var(--teal);}
.start-title{font-size:clamp(1.7rem,4vw,2.4rem);font-weight:900;color:var(--pri-d);margin-top:4px;}
.start-sub{margin-top:5px;font-size:14px;font-weight:700;color:var(--mut);}

.start-section{margin-top:16px;text-align:left;}
.start-label{
  margin-bottom:7px;
  font-size:11px;
  font-weight:900;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:var(--mut);
}
.seg{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  padding:5px;
  border-radius:16px;
  border:1.5px solid var(--line);
  background:#FFF3E4;
}
.seg-wrap{grid-template-columns:repeat(2,minmax(0,1fr));}
.seg button{
  min-height:44px;
  padding:4px 6px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--mut);
  font-family:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
  transition:background .14s ease,color .14s ease,box-shadow .14s ease,transform .14s ease;
}
.seg button.is-on{
  background:#fff;
  color:var(--pri-d);
  box-shadow:0 3px 0 #E8C9A8;
  transform:translateY(-1px);
}
.seg button:focus-visible{outline:2px solid var(--teal);outline-offset:1px;}

.mascot-pickers{display:flex;flex-direction:column;gap:8px;}
.mascot-row{display:flex;align-items:center;gap:7px;}
.mascot-row[hidden]{display:none;}
.mascot-tag{
  flex:0 0 30px;
  font-size:12px;
  font-weight:900;
  color:var(--pri-d);
}
.mascot-opt{
  flex:1 1 0;
  min-width:0;
  padding:10px 5px 8px;
  border-radius:18px;
  border:2px solid var(--line);
  background:#fff;
  color:var(--ink);
  font-family:inherit;
  cursor:pointer;
  box-shadow:0 4px 0 #F3DDC7;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  transition:transform .14s ease,border-color .14s ease,background .14s ease,box-shadow .14s ease;
}
.mascot-opt:active{transform:translateY(2px);box-shadow:none;}
.mascot-opt.is-on{border-color:var(--pri);background:var(--pri-l);transform:translateY(-3px);box-shadow:0 7px 0 #E8C9A8;}
.mascot-emoji{font-size:clamp(1.8rem,4.4vw,2.6rem);line-height:1;}
.mascot-name{font-size:11px;font-weight:900;color:var(--mut);}
.mascot-opt.is-on .mascot-name{color:var(--pri-d);}

.start-btn{
  width:100%;
  min-height:64px;
  margin-top:20px;
  border:0;
  border-radius:20px;
  cursor:pointer;
  font-family:inherit;
  color:#fff;
  font-size:clamp(1.15rem,2.4vw,1.45rem);
  font-weight:900;
  letter-spacing:.5px;
  background:linear-gradient(180deg,#FFB061,var(--pri) 45%,var(--pri-d));
  box-shadow:0 7px 0 #A94A15,0 12px 22px rgba(199,91,31,.28),inset 0 2px 0 rgba(255,255,255,.42);
  transition:transform .12s ease,box-shadow .12s ease;
}
.start-btn:active{transform:translateY(4px);box-shadow:0 3px 0 #A94A15;}
.start-btn:focus-visible{outline:3px solid var(--teal);outline-offset:3px;}
.start-hint{margin-top:12px;font-size:12px;font-weight:700;color:var(--mut);}

/* ---------- 终点庆祝 ---------- */
.finale{
  position:fixed;
  inset:0;
  z-index:95;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(42,26,15,.5);
  backdrop-filter:blur(8px);
}
.finale[hidden]{display:none;}
.finale-panel{
  width:min(520px,100%);
  padding:clamp(22px,4vw,34px);
  border-radius:34px;
  border:3px solid #F6C79C;
  background:
    radial-gradient(circle at 50% 0%,rgba(255,201,74,.4),transparent 48%),
    linear-gradient(180deg,#fff,#FFF7EC);
  box-shadow:0 24px 60px rgba(42,26,15,.3),0 8px 0 #E8C9A8;
  text-align:center;
  animation:startIn .45s cubic-bezier(.34,1.4,.64,1) both;
}
.finale-trophy{font-size:clamp(3.6rem,8vw,5.2rem);line-height:1;animation:trophyBounce 1.1s cubic-bezier(.34,1.56,.64,1) both;}
@keyframes trophyBounce{
  0%{transform:scale(.4) rotate(-12deg);opacity:0;}
  55%{transform:scale(1.18) rotate(4deg);opacity:1;}
  100%{transform:none;}
}
.finale-title{font-size:clamp(2rem,4.6vw,3rem);font-weight:900;color:var(--pri-d);margin-top:4px;}
.finale-players{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:9px;
  margin:12px 0 4px;
}
.finale-player{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:999px;
  background:linear-gradient(180deg,#FFF9DA,#FFF0B0);
  border:1.5px solid #EAD98A;
  color:#8A6A00;
  font-size:13px;
  font-weight:900;
}
.finale-player-face{font-size:20px;line-height:1;}
.finale-player-stars{white-space:nowrap;}
.finale-msg{font-size:15px;font-weight:800;color:var(--ink);line-height:1.55;margin:6px 0 16px;white-space:pre-line;}
.finale-panel .again-btn{
  width:100%;
  min-height:56px;
  border:0;
  border-radius:18px;
  padding:10px 18px;
  font-family:inherit;
  font-size:clamp(1rem,1.8vw,1.2rem);
  font-weight:900;
  color:#fff;
  cursor:pointer;
  background:linear-gradient(180deg,#FFB061,var(--pri) 45%,var(--pri-d));
  box-shadow:0 6px 0 #A94A15,0 10px 18px rgba(199,91,31,.24),inset 0 2px 0 rgba(255,255,255,.4);
}
.finale-panel .again-btn:active{transform:translateY(3px);box-shadow:0 3px 0 #A94A15;}
.finale-panel .again-btn:focus-visible{outline:3px solid var(--teal);outline-offset:3px;}

/* ---------- 全屏 ---------- */
body.is-fullscreen .dice-wrap{
  max-width:min(1320px,98vw);
  height:100dvh;
  margin:0 auto;
  padding:10px 14px;
  display:flex;
  flex-direction:column;
}
body.is-fullscreen .top,
body.is-fullscreen .tips{display:none;}
body.is-fullscreen .game{
  flex:1 1 auto;
  min-height:0;
  margin-top:0;
  grid-template-columns:minmax(0,1.45fr) minmax(300px,.68fr);
  gap:14px;
  align-items:stretch;
}
body.is-fullscreen .route-wrap{
  min-height:0;
  padding:10px;
  overflow:hidden;
  align-self:center;
}
body.is-fullscreen .route-board{--route-h:calc(100dvh - 36px);}
body.is-fullscreen .panel{
  position:static;
  min-height:0;
  overflow:auto;
  padding:14px;
}
body.is-fullscreen .task-idle{min-height:140px;}
body.is-fullscreen .done-btn{position:sticky;bottom:0;}

/* ---------- 响应式 ---------- */
@media (max-width:860px){
  .game{grid-template-columns:minmax(0,1fr);}
  .panel{position:static;}
}

@media (orientation:portrait){
  .route-board{
    --route-h:min(calc(100dvh - 320px),64vh);
  }
  .stop{width:clamp(34px,9.2%,62px);}
  .token{width:clamp(30px,7.6%,52px);}
  body.is-fullscreen .route-board{--route-h:46dvh;}
  body.is-fullscreen .panel{overflow:auto;gap:9px;padding:10px;}
  body.is-fullscreen .task-tip{display:none;}
  body.is-fullscreen .task-art{height:clamp(64px,10vh,92px);}
  body.is-fullscreen .task-en{font-size:clamp(1.15rem,4.2vw,1.65rem);}
  body.is-fullscreen .task-idle{min-height:90px;}
  body.is-fullscreen .player-card{min-height:46px;}
  body.is-fullscreen .dice{width:64px;border-radius:18px;}
  body.is-fullscreen .roll-btn{min-height:52px;}
  body.is-fullscreen .roll-result{font-size:11px;}
  body.is-fullscreen .done-btn{min-height:48px;}
}

@media (max-width:860px) and (orientation:portrait){
  body.is-fullscreen .game{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr);
    overflow:hidden;
  }
  body.is-fullscreen .route-wrap{flex:0 0 auto;align-self:start;}
  body.is-fullscreen .panel{overflow:auto;}
}

/* 手机全屏：压缩面板，保证骰子、任务卡、Done 按钮同屏 */
@media (max-width:700px){
  body.is-fullscreen .panel{padding:12px;gap:10px;}
  body.is-fullscreen .player-card{min-height:48px;padding:5px 8px;}
  body.is-fullscreen .player-avatar{font-size:1.35rem;}
  body.is-fullscreen .dice{width:64px;border-radius:18px;}
  body.is-fullscreen .roll-btn{min-height:56px;}
  body.is-fullscreen .roll-result{font-size:11px;}
  body.is-fullscreen .task-art{height:84px;}
  body.is-fullscreen .task-tip{display:none;}
  body.is-fullscreen .task-idle{min-height:110px;}
  body.is-fullscreen .done-btn{min-height:52px;}
}

@media (max-width:700px) and (orientation:portrait){
  body.is-fullscreen .route-board{--route-h:44dvh;}
  body.is-fullscreen .panel{padding:9px;gap:8px;}
  body.is-fullscreen .player-card{min-height:44px;}
  body.is-fullscreen .dice{width:58px;}
  body.is-fullscreen .roll-btn{min-height:50px;}
  body.is-fullscreen .task-art{height:70px;}
}

@media (min-width:768px){
  .seg-wrap{grid-template-columns:repeat(4,minmax(0,1fr));}
}

@media (max-width:480px){
  .dice-wrap{padding:14px 12px 28px;}
  .route-wrap{padding:10px;border-radius:24px;}
  .route-board{border-radius:18px;}
  .panel{padding:14px;border-radius:24px;}
  .dice-dock{gap:10px;}
  .dice{width:76px;border-radius:18px;}
  .roll-btn{min-height:58px;border-radius:17px;}
  .task-idle{min-height:150px;}
  .mascot-row{gap:5px;}
  .mascot-opt{padding:9px 3px 7px;}
  .start-panel{padding:20px 16px;}
}

@media (max-height:760px){
  body.is-fullscreen .dice-wrap{padding:6px 10px;}
  body.is-fullscreen .task-art{height:clamp(70px,14vh,110px);}
  body.is-fullscreen .task-idle{min-height:110px;}
  body.is-fullscreen .idle-mascot{font-size:2.2rem;}
}

@media (max-height:560px) and (orientation:landscape){
  body.is-fullscreen .dice-wrap{padding:6px 10px;}
  body.is-fullscreen .game{gap:10px;}
  body.is-fullscreen .task-art{height:64px;}
  body.is-fullscreen .task-en{font-size:1.2rem;}
  body.is-fullscreen .task-tip{display:none;}
  body.is-fullscreen .done-btn{min-height:48px;}
  body.is-fullscreen .task-idle{min-height:80px;}
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion:reduce){
  .token{transition:none;}
  .token.hop,.hop-bubble.show,.stop.is-current,.dice.is-rolling,
  .player-stars b.pop,.idle-mascot,.finale-trophy,.player-trophy,
  .task-card,.start-panel,.finale-panel{animation:none !important;}
  .confetti{display:none;}
}
