:root {
  --pink: #ff5f8f;
  --blue: #4f8cff;
  --bg: #ffeef4;
  --card: #fff;
  --text: #4a3550;
  --muted: #a98aa6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #ffeef4, #fff6f9 40%, #eef4ff);
  color: var(--text);
  min-height: 100vh;
}
.stage { max-width: 560px; margin: 0 auto; padding: 12px 14px 30px; }

.topbar { display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 20px; margin: 4px 0; flex: 1; }
.icon-btn {
  border: none; background: #fff; border-radius: 50%;
  width: 40px; height: 40px; font-size: 18px;
  box-shadow: 0 2px 8px rgba(200, 60, 120, .15); cursor: pointer;
}

/* 玩家条 */
.players { display: flex; align-items: center; gap: 8px; margin: 10px 0 12px; }
.player {
  flex: 1; background: #fff; border-radius: 14px; padding: 8px 10px;
  display: flex; align-items: center; gap: 6px;
  box-shadow: 0 2px 10px rgba(200, 60, 120, .08);
}
.player.on { outline: 2px solid var(--pink); }
.player .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pname { border: none; background: none; font-size: 15px; font-weight: 700; width: 62px; color: var(--text); }
.pstat { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.vs { font-weight: 900; color: #e05a80; font-size: 13px; }

/* 棋盘：6列 × 5行 蛇形 */
.board {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 6px; padding: 10px; background: #fff;
  border-radius: 18px; box-shadow: 0 4px 18px rgba(200, 60, 120, .12);
}
.cell {
  position: relative; aspect-ratio: 1; border-radius: 10px;
  background: #fff5f9; border: 1px solid #fbdde9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: #b98bb0; overflow: hidden;
}
.cell .ico { font-size: 16px; line-height: 1; }
.cell.start { background: #fff0c2; }
.cell.end { background: #ffe0ec; }
.cell.task-light { background: #fff8e1; }
.cell.task-medium { background: #ffe9e2; }
.cell.task-hot { background: #ffdbe6; }
.cell.plus { background: #e6ffed; }
.cell.minus { background: #e8f0ff; }
.cell.skip { background: #f0e6ff; }
.cell.again { background: #e0fff9; }
.piece {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  display: none; z-index: 2;
}

/* 控制区 */
.controls { margin-top: 14px; text-align: center; }
.turn-line { font-size: 15px; margin-bottom: 10px; }
.turn-line b { color: var(--pink); }
.dice-area { display: flex; align-items: center; justify-content: center; gap: 12px; }
.dice {
  border: none; background: linear-gradient(135deg, #ff5f8f, #ff8fb0);
  color: #fff; font-size: 20px; font-weight: 800;
  padding: 14px 34px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(255, 95, 143, .4); cursor: pointer;
}
.dice:active { transform: scale(.96); }
.dice.rolling { animation: shake .4s infinite; }
@keyframes shake { 0%{transform:rotate(0)} 25%{transform:rotate(-8deg)} 50%{transform:rotate(8deg)} 75%{transform:rotate(-8deg)} 100%{transform:rotate(0)} }
.last-roll { font-size: 22px; font-weight: 900; color: #e05a80; min-width: 26px; }
.btn { border-radius: 999px; padding: 11px 26px; font-size: 15px; font-weight: 700; cursor: pointer; border: none; }
.btn.solid { background: linear-gradient(135deg, #ff5f8f, #ff8fb0); color: #fff; }
.btn.ghost { background: #fff; color: var(--pink); box-shadow: 0 2px 8px rgba(200,60,120,.12); }
.btn.sm { padding: 8px 18px; font-size: 14px; }
.btn.block { width: 100%; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(60,20,45,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.card-pop {
  width: 100%; max-width: 380px; background: #fff; border-radius: 22px;
  padding: 26px 22px; text-align: center; animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.card-tag { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff; background: var(--pink); margin-bottom: 14px; }
.card-tag.light { background: #f5b942; }
.card-tag.medium { background: #ff7a59; }
.card-tag.hot { background: #e63d6b; }
.card-text { font-size: 20px; font-weight: 800; line-height: 1.5; min-height: 44px; }
.card-who { margin: 12px 0 18px; color: var(--muted); font-size: 14px; }
.card-pop .btn { width: 100%; }

/* 设置面板 */
.sheet { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f4e3ee; }
.sheet-body { padding: 14px 16px; overflow-y: auto; }
.field { margin-bottom: 16px; }
.field > label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #f0c4d8; color: #b06a8c; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.chip input { display: none; }
.chip.on { background: var(--pink); color: #fff; border-color: var(--pink); }
textarea, select {
  width: 100%; border: 1px solid #f0c4d8; border-radius: 12px; padding: 10px;
  font-size: 15px; color: var(--text); background: #fffafc; font-family: inherit;
}
.add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-row select { width: 110px; }
.custom-list { list-style: none; padding: 0; margin: 0; }
.custom-list li {
  background: #fff5f9; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  font-size: 14px; display: flex; gap: 8px; align-items: flex-start;
}
.custom-list li:active { background: #ffe3ef; }
.custom-list .del { margin-left: auto; color: #e05a80; font-weight: 800; cursor: pointer; flex: none; }
.custom-list .lv { color: var(--muted); font-size: 12px; flex: none; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
