/* /var/www/html/assets/css/dice.css : 주사위 굴리기 도구 전용 스타일 (파스텔 톤) */

.dc-tool { margin-top: 8px; }

/* ---------- 설정 바 ---------- */
.dc-setup {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(142, 202, 230, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(200, 214, 240, 0.16), rgba(200, 214, 240, 0.06));
  border: 1px solid rgba(142, 160, 210, 0.2);
  border-radius: 20px;
}
.dc-count { justify-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.dc-type { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dc-actions { justify-self: end; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.dc-count-label, .dc-type-label { font-weight: 800; font-size: 0.9rem; color: #fff; white-space: nowrap; }

.dc-stepper {
  display: inline-flex; align-items: center; gap: 2px;
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 12px; padding: 4px;
}
.dc-step {
  width: 34px; height: 34px; border: none; border-radius: 9px; background: transparent;
  font-size: 1.3rem; line-height: 1; cursor: pointer; color: #14161a;
  transition: background 0.12s ease, transform 0.08s ease;
}
.dc-step:hover { background: rgba(0, 0, 0, 0.06); }
.dc-step:active { transform: scale(0.9); }
.dc-step:disabled { opacity: 0.3; cursor: not-allowed; }
.dc-count-input {
  width: 46px; height: 34px; text-align: center; font-weight: 800; font-size: 1.1rem;
  color: #14161a; border: none; background: transparent; -moz-appearance: textfield; appearance: textfield;
}
.dc-count-input::-webkit-outer-spin-button, .dc-count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dc-count-input:focus { outline: none; }

.dc-type-btns {
  display: inline-flex; flex-wrap: wrap; background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 12px; padding: 4px; gap: 2px;
}
.dc-type-btn {
  border: none; background: transparent; padding: 7px 12px; border-radius: 9px;
  font-weight: 700; font-size: 0.82rem; color: #5a6478; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.dc-type-btn:hover { background: rgba(0, 0, 0, 0.05); }
.dc-type-btn.is-active {
  background: linear-gradient(135deg, #9cd3ef, #b9b3ee); color: #2f3a4d;
  box-shadow: 0 2px 8px rgba(150, 175, 225, 0.4);
}
.dc-type-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.dc-setup .btn {
  border-radius: 999px; padding: 11px 22px; font-weight: 700;
  border: 1px solid rgba(142, 160, 210, 0.28); box-shadow: 0 2px 8px rgba(142, 160, 210, 0.18);
  transition: transform 0.08s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.dc-setup .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(142, 160, 210, 0.28); }
.dc-setup .btn:active { transform: scale(0.97); }
.dc-actions .btn-primary {
  background-image: linear-gradient(135deg, #9cd3ef, #b9b3ee); border: none; color: #2f3a4d;
  box-shadow: 0 4px 14px rgba(150, 175, 225, 0.45);
}
.dc-actions .btn-primary:hover { filter: brightness(1.05); }

@media (max-width: 900px) {
  .dc-setup { grid-template-columns: 1fr; justify-items: center; }
  .dc-count, .dc-type, .dc-actions { justify-self: center; }
  .dc-count { align-items: center; }
}

/* ---------- 주사위 무대 ---------- */
.dc-stage {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 16px; min-height: 180px; padding: 28px 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(142, 202, 230, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(200, 214, 240, 0.14), rgba(200, 214, 240, 0.05));
  border: 1px solid rgba(142, 160, 210, 0.2); border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 12px 32px rgba(150, 170, 210, 0.14);
}

.dc-die {
  display: grid; place-items: center;
  width: 74px; height: 74px;
  background: linear-gradient(155deg, #ffffff, #eef1f8);
  border: 1px solid rgba(120, 140, 190, 0.28); border-radius: 16px;
  box-shadow: 0 6px 16px rgba(120, 140, 190, 0.28), inset 0 2px 3px rgba(255, 255, 255, 0.9);
  color: #2f3a4d;
}
.dc-die.is-rolling { animation: dc-shake 0.28s linear infinite; }
.dc-die.is-landed { animation: dc-pop 0.36s ease; }

@keyframes dc-shake {
  0% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-4px) rotate(-7deg); }
  50% { transform: translateY(0) rotate(0); }
  75% { transform: translateY(-3px) rotate(7deg); }
  100% { transform: translateY(0) rotate(0); }
}
@keyframes dc-pop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* 숫자 면 */
.dc-num { font-size: 2rem; font-weight: 900; }

/* 점(pip) 면 */
.dc-pips {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 5px; width: 54px; height: 54px;
}
.dc-pip-cell { display: block; }
.dc-pip-cell.is-on {
  background: radial-gradient(circle at 35% 30%, #6f86c9, #3f4d78);
  border-radius: 50%;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- 합계 ---------- */
.dc-total {
  margin-top: 16px; text-align: center; font-size: 1.05rem; font-weight: 700; color: #4a5468;
  animation: dc-fade 0.35s ease;
}
.dc-total[hidden] { display: none; }
.dc-total-num {
  display: inline-block; margin: 0 4px; min-width: 46px; padding: 4px 14px;
  border-radius: 999px; font-size: 1.5rem; font-weight: 900; color: #2f3a4d;
  background: linear-gradient(135deg, #ffe6b8, #ffd0dd);
}
.dc-total-detail { color: #8a92a4; font-weight: 600; font-size: 0.9rem; }

@keyframes dc-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.dc-status { margin-top: 12px; font-size: 0.95rem; color: #667085; min-height: 1.4em; text-align: center; }

/* ---------- 안내 ---------- */
.dc-guide { margin-top: 34px; }
.dc-guide h2 { margin-bottom: 12px; }
.dc-guide h3 { margin: 18px 0 4px; font-size: 1rem; }
.dc-guide ol, .dc-guide ul { padding-left: 20px; line-height: 1.7; }
.dc-guide li { margin-bottom: 4px; }

/* ---------- 모바일 ---------- */
@media (max-width: 560px) {
  .dc-actions { width: 100%; justify-content: center; }
  .dc-die { width: 62px; height: 62px; }
  .dc-num { font-size: 1.7rem; }
  .dc-pips { width: 46px; height: 46px; }
}

/* ---------- 다크 모드 ---------- */
@media (prefers-color-scheme: dark) {
  .dc-setup { background: #1e1f24; border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
  .dc-count-label, .dc-type-label { color: #eef1f6; }
  .dc-stepper, .dc-type-btns { background: #17181c; border-color: rgba(255, 255, 255, 0.14); }
  .dc-step { color: #e8ebf2; }
  .dc-step:hover { background: rgba(255, 255, 255, 0.08); }
  .dc-count-input { color: #f0f2f6; }
  .dc-type-btn { color: #c3c9d4; }
  .dc-type-btn:hover { background: rgba(255, 255, 255, 0.08); }
  .dc-stage { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.3); }
  .dc-die { background: linear-gradient(155deg, #2b2d34, #212228); border-color: rgba(255, 255, 255, 0.14); color: #eef1f6; }
  .dc-pip-cell.is-on { background: radial-gradient(circle at 35% 30%, #aebbe6, #7787bd); }
  .dc-total { color: #c3c9d4; }
  .dc-total-detail { color: #8b93a5; }
  .dc-status { color: #9aa0aa; }
}
