:root {
  --bg: #f6ebe4;
  --card: #fffaf6;
  --line: rgba(90, 50, 60, 0.1);
  --gold: #c48a4a;
  --text: #3a2a32;
  --mute: #8a7380;
  --accent: #e08aa0;
  --rose: #f3c5cf;
  --peach: #f6d4b8;
  --goldbg: #f0dfb8;
  --mint: #cfe8d8;
  --lilac: #ddd0ee;
  --sky: #cfe0f2;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-image: radial-gradient(rgba(224,138,160,0.12) 1px, transparent 1px);
  background-size: 18px 18px;
}
.app { width: min(480px, 100%); margin: 0 auto; min-height: 100dvh; padding: 16px 16px 32px; }
.app.play { padding-bottom: 168px; }
.dock {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); padding: 10px 16px 18px;
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
  z-index: 5;
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.brand { font-size: 13px; letter-spacing: 0.18em; color: var(--gold); }
.logo-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 8px; }
.heart {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(180deg, #f7c9d4, #e08aa0);
  display: grid; place-items: center; color: #fff; font-size: 18px;
}
h1 { font-size: 26px; margin: 0; }
.sub { color: var(--mute); margin: 4px 0 16px; font-size: 14px; }
.icon-btn, .ghost, .primary, .tile, .mode, .flip { border: 0; cursor: pointer; font-size: 14px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(80,40,50,0.06);
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  border-radius: 22px; padding: 16px 14px 18px;
  text-align: left; color: var(--text); min-height: 132px;
  box-shadow: 0 10px 24px rgba(80,40,50,0.08);
}
.tile.rose { background: linear-gradient(180deg, #fff, #fde6eb); }
.tile.peach { background: linear-gradient(180deg, #fff, #fde8d6); }
.tile.gold { background: linear-gradient(180deg, #fff, #f7ebc8); }
.tile.mint { background: linear-gradient(180deg, #fff, #dcefe4); }
.tile.lilac { background: linear-gradient(180deg, #fff, #ece4f8); }
.tile.sky { background: linear-gradient(180deg, #fff, #dceaf6); }
.tile b { display: block; font-size: 18px; margin: 6px 0; }
.tile span { color: var(--mute); font-size: 12px; line-height: 1.5; }
.tag { display: inline-block; font-size: 11px; color: var(--gold); }
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
input {
  width: 100%; padding: 11px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 15px;
}
.modes { display: flex; gap: 8px; margin: 8px 0 16px; }
.mode {
  flex: 1; padding: 10px 6px; border-radius: 14px;
  background: #fff; color: var(--text); border: 1px solid var(--line);
}
.mode.on { border-color: var(--accent); background: #fff1f4; color: #b45c74; }
.primary {
  width: 100%; padding: 13px; border-radius: 16px; margin-top: 10px;
  background: linear-gradient(180deg, #ef9aaf, #d97892); color: #fff; font-weight: 700;
}
.ghost {
  width: 100%; padding: 12px; border-radius: 16px; margin-top: 8px;
  background: #fff; color: var(--gold); border: 1px solid rgba(196,138,74,0.28);
}
.board {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 8px 0 12px;
}
.cell {
  aspect-ratio: 1; border-radius: 12px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--mute); position: relative;
  border: 1px solid var(--line);
}
.cell.ask { background: #e8f4ee; }
.cell.do { background: #fde8ee; }
.cell.gift { background: #f8ecd0; }
.cell.rest { background: #e7eef8; }
.cell.start, .cell.end { background: #f3d6c4; color: #8a5a3a; font-weight: 700; }
.cell.here { box-shadow: 0 0 0 2px #e08aa0; }
.pawns { position: absolute; bottom: 2px; display: flex; gap: 2px; }
.dot, .pawn {
  width: 14px; height: 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 8px; color: #fff; font-weight: 700;
}
.a { background: #e08aa0; }
.b { background: #c48a4a; }
.hud { font-size: 13px; color: var(--mute); margin: 8px 0; text-align: center; }
.dice {
  width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 18px;
  background: #fff; color: #3a2a32; display: grid; place-items: center;
  font-size: 32px; font-weight: 800; box-shadow: 0 12px 24px rgba(80,40,50,0.12);
}
.pips { width: 46px; height: 46px; display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.pips i { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin: auto; }
.pips i.on { background: #3a2a32; }
.boot {
  min-height: 100dvh; display: grid; place-items: center; text-align: center;
}
.history { font-size: 12px; color: var(--mute); text-align: center; min-height: 18px; }
.list { text-align: left; max-height: 160px; overflow: auto; font-size: 13px; }
.list div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.dice.spin { animation: spin 0.7s ease; }
@keyframes spin {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}
.sheet {
  width: min(480px, 100%); margin: 0 auto;
  background: #fff; border-radius: 24px 24px 0 0; padding: 20px 16px 28px;
  box-shadow: 0 -12px 40px rgba(80,40,50,0.12);
}
.mask {
  position: fixed; inset: 0; background: rgba(40,20,28,0.35);
  display: flex; align-items: flex-end; z-index: 40;
}
.kind { font-size: 12px; color: var(--gold); letter-spacing: 0.14em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flip {
  aspect-ratio: 3/4; border-radius: 14px; background: linear-gradient(180deg,#f7c9d4,#e08aa0);
  color: #fff; font-size: 20px; box-shadow: 0 8px 16px rgba(80,40,50,0.1);
}
.flip.open { background: #fff; color: var(--text); font-size: 12px; padding: 8px; border: 1px solid var(--line); }
.mine-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mine-grid .cell { font-size: 18px; min-height: 48px; }
.cell.safe { color: #5d9a78; background: #e7f3eb; }
.cell.boom { color: #fff; background: #e08aa0; }
.big { font-size: 56px; text-align: center; margin: 18px 0 8px; }
.footer { margin-top: 18px; text-align: center; color: var(--mute); font-size: 12px; }
.primary:disabled { opacity: 0.45; }
.score { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pill {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 10px; font-size: 13px; color: var(--mute); text-align: center;
}
.pill.on { border-color: var(--accent); color: #b45c74; background: #fff1f4; }
.rule { color: var(--mute); font-size: 13px; line-height: 1.6; margin: 0 0 10px; }
.pick {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.pick .mode { min-height: 72px; }
.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #fff1f4; color: #b45c74; margin-left: 6px;
}
