/* 骰子比大小 · 同屏双人（左 P1 蓝 / 右 P2 红，桌面绒面） */

.g-dice {
  padding-left: 12px;
  padding-right: 12px;
  gap: 10px;
}
.g-dice .dc-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ---------------- 初始界面 ---------------- */
.g-dice .dc-idle {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 20px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(90, 130, 255, 0.15), transparent 58%),
    radial-gradient(120% 80% at 80% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 58%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  text-align: center;
  overflow-y: auto;
}
.g-dice .dc-idle-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 30px;
  font-weight: 900;
  color: #2a0509;
  background: linear-gradient(150deg, #ff8d98, var(--accent) 55%, var(--accent2));
  box-shadow: 0 12px 30px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.g-dice .dc-idle-title { font-size: 21px; font-weight: 800; }
.g-dice .dc-idle-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 30em;
  margin: 0 auto;
}
.g-dice .dc-label,
.g-dice .dc-histlabel { font-size: 10.5px; letter-spacing: 0.14em; color: var(--faint); }
.g-dice .dc-seg .seg { width: 100%; }
.g-dice .dc-mode-desc { font-size: 11.5px; color: var(--dim); min-height: 17px; }
.g-dice .dc-history { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; }
.g-dice .dc-record {
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  border-radius: 12px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.g-dice .dc-record.p1 { color: #9dbcff; border-color: rgba(90, 130, 255, 0.42); background: rgba(90, 130, 255, 0.1); }
.g-dice .dc-record.p2 { color: #ff9aa3; border-color: rgba(255, 92, 108, 0.42); background: rgba(255, 92, 108, 0.1); }
.g-dice .dc-record-sep { font-size: 15px; color: var(--faint); font-weight: 700; }
.g-dice .dc-record-count { font-size: 10.5px; color: var(--faint); margin-left: 3px; }
.g-dice .dc-rule { font-size: 11px; line-height: 1.6; color: var(--faint); }
.g-dice .dc-rule b { color: var(--accent); font-weight: 700; }

/* ---------------- 进行中 ---------------- */
.g-dice .dc-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.g-dice .dc-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  flex: none;
}
.g-dice .dc-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
}
.g-dice .dc-tag.p1 { color: #bcd0ff; background: rgba(90, 130, 255, 0.2); border: 1px solid rgba(90, 130, 255, 0.4); }
.g-dice .dc-tag.p2 { color: #ffc4ca; background: rgba(255, 92, 108, 0.18); border: 1px solid rgba(255, 92, 108, 0.4); }
.g-dice .dc-score { font-size: 30px; font-weight: 900; line-height: 1; min-width: 26px; }
.g-dice .dc-score.p1 { color: #9dbcff; }
.g-dice .dc-score.p2 { color: #ff8d98; }
.g-dice .dc-colon { font-size: 22px; color: var(--faint); font-weight: 700; }
.g-dice .dc-roundtext { text-align: center; font-size: 11px; color: var(--faint); flex: none; }
.g-dice .dc-status {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-height: 22px;
  flex: none;
  color: var(--dim);
}
.g-dice .dc-status.active-p1 { color: #9dbcff; }
.g-dice .dc-status.active-p2 { color: #ff9aa3; }
.g-dice .dc-status.p1 { color: #9dbcff; animation: dcPop 0.35s ease; }
.g-dice .dc-status.p2 { color: #ff9aa3; animation: dcPop 0.35s ease; }
.g-dice .dc-status.tie { color: #ffd166; animation: dcPop 0.35s ease; }
@keyframes dcPop {
  0% { transform: scale(0.85); opacity: 0; }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.g-dice .dc-arena {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, #0e3b2c, #08251c 58%, #051812);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55);
}
.g-dice .dc-side {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 8px;
}
.g-dice .dc-side.p1 { background: linear-gradient(160deg, rgba(90, 130, 255, 0.16), transparent 62%); }
.g-dice .dc-side.p2 { background: linear-gradient(160deg, transparent 38%, rgba(255, 92, 108, 0.15)); }
.g-dice .dc-side-label {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.07);
}
.g-dice .dc-side.p1 .dc-side-label { color: #cddcff; box-shadow: 0 0 18px -6px #5f8bff; }
.g-dice .dc-side.p2 .dc-side-label { color: #ffd0d5; box-shadow: 0 0 18px -6px var(--accent); }
.g-dice .dc-divider {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22) 18%, rgba(255, 255, 255, 0.22) 82%, transparent);
  pointer-events: none;
  z-index: 2;
}

.g-dice .dc-dice-row { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 84px; }
.g-dice .dc-die {
  width: clamp(76px, 21vw, 94px);
  aspect-ratio: 1;
  border-radius: 16px;
  padding: 11%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 9%;
  background: linear-gradient(145deg, #ffffff 0%, #f2f4f9 58%, #dfe3ec 100%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.5), inset 0 -4px 8px rgba(0, 0, 0, 0.09), inset 0 2px 2px rgba(255, 255, 255, 0.9);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  position: relative;
}
.g-dice .dc-dice-row.two .dc-die { width: clamp(58px, 16vw, 70px); border-radius: 13px; }
.g-dice .dc-pip {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
  background: #1c2230;
  box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.25), 0 1px 1px rgba(255, 255, 255, 0.5);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.1s ease, transform 0.12s ease;
}
.g-dice .dc-pip.on { opacity: 1; transform: scale(1); }
.g-dice .dc-die[data-value="1"] .dc-pip.on { background: #d92f42; }
.g-dice .dc-die.empty { opacity: 0.62; }
.g-dice .dc-die.empty .dc-pip.on { background: #8b93a5; transform: scale(0.85); }
.g-dice .dc-die.rolling { animation: dcRoll 0.5s cubic-bezier(0.3, 0.1, 0.4, 1) both; }
@keyframes dcRoll {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-16px) rotate(-18deg) scale(1.06); }
  55% { transform: translateY(4px) rotate(12deg) scale(0.97); }
  78% { transform: translateY(-5px) rotate(-5deg) scale(1.02); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}
.g-dice .dc-total {
  font-size: 17px;
  font-weight: 800;
  color: var(--faint);
  min-height: 22px;
  font-variant-numeric: tabular-nums;
}
.g-dice .dc-total.win { color: var(--ok); text-shadow: 0 0 16px rgba(62, 207, 142, 0.5); }
.g-dice .dc-roll {
  width: 100%;
  max-width: 150px;
  height: 50px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: var(--text);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  transition: transform 0.08s ease, background 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
  touch-action: manipulation;
}
.g-dice .dc-roll.p1.on {
  color: #eaf0ff;
  background: linear-gradient(160deg, #6d93ff, #3557cf);
  border-color: rgba(150, 185, 255, 0.7);
  box-shadow: 0 0 26px -8px #5f8bff, inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.g-dice .dc-roll.p2.on {
  color: #2a0509;
  background: linear-gradient(160deg, #ff8d98, var(--accent) 55%, var(--accent2));
  border-color: rgba(255, 180, 190, 0.7);
  box-shadow: 0 0 26px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.g-dice .dc-roll:disabled { opacity: 0.34; background: rgba(255, 255, 255, 0.05); border-color: var(--line); box-shadow: none; }
.g-dice .dc-roll:active:not(:disabled) { transform: scale(0.95); }
.g-dice .dc-hint { text-align: center; font-size: 10.5px; flex: none; }

/* ---------------- 结算 ---------------- */
.g-dice .dc-result {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(110% 70% at 50% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  text-align: center;
  overflow-y: auto;
}
.g-dice .dc-result-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border-radius: 999px;
  padding: 5px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
}
.g-dice .dc-result-badge.p1 { color: #bcd0ff; border-color: rgba(90, 130, 255, 0.5); background: rgba(90, 130, 255, 0.12); }
.g-dice .dc-result-badge.p2 { color: #ffc4ca; border-color: rgba(255, 92, 108, 0.5); background: rgba(255, 92, 108, 0.12); }
.g-dice .dc-result-k { font-size: 11.5px; color: var(--faint); }
.g-dice .dc-result-score { display: flex; align-items: baseline; gap: 4px; margin-top: -2px; }
.g-dice .dc-score-n {
  font-size: 62px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: #ff8d98;
  filter: drop-shadow(0 8px 20px rgba(255, 92, 108, 0.4));
}
.g-dice .dc-score-n.p1 { color: #9dbcff; filter: drop-shadow(0 8px 20px rgba(90, 130, 255, 0.4)); }
.g-dice .dc-score-k { font-size: 14px; color: var(--faint); }
.g-dice .dc-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
}
.g-dice .dc-result-grid .stat { background: rgba(255, 255, 255, 0.04); padding: 8px 5px; }
.g-dice .dc-result-actions { display: flex; gap: 8px; width: 100%; margin-top: 2px; }
.g-dice .dc-result-actions .btn { flex: 1; min-height: 46px; }

@media (max-height: 700px) {
  .g-dice .dc-idle-icon { width: 52px; height: 52px; font-size: 25px; border-radius: 16px; }
  .g-dice .dc-rule { display: none; }
  .g-dice .dc-play { gap: 5px; }
  .g-dice .dc-side { gap: 8px; padding: 8px 6px; }
  .g-dice .dc-dice-row { min-height: 70px; }
  .g-dice .dc-die { width: clamp(58px, 16vw, 70px); border-radius: 13px; }
  .g-dice .dc-dice-row.two .dc-die { width: 50px; }
  .g-dice .dc-roll { height: 44px; }
  .g-dice .dc-score-n { font-size: 52px; }
  .g-dice .dc-hint { display: none; }
  .g-dice .dc-idle { padding: 14px 12px; gap: 7px; }
}
