/* /var/www/html/assets/css/coin.css : 동전 던지기 도구 전용 스타일 (파스텔 톤) */

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

/* ---------- 설정 바 ---------- */
.cn-setup {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  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;
}
.cn-count { display: flex; flex-direction: column; gap: 6px; }
.cn-count-label { font-weight: 800; font-size: 0.9rem; color: #fff; }
.cn-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.cn-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;
}
.cn-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;
}
.cn-step:hover { background: rgba(0, 0, 0, 0.06); }
.cn-step:active { transform: scale(0.9); }
.cn-step:disabled { opacity: 0.3; cursor: not-allowed; }
.cn-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;
}
.cn-count-input::-webkit-outer-spin-button, .cn-count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cn-count-input:focus { outline: none; }

.cn-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;
}
.cn-setup .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(142, 160, 210, 0.28); }
.cn-setup .btn:active { transform: scale(0.97); }
.cn-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);
}
.cn-actions .btn-primary:hover { filter: brightness(1.05); }

@media (max-width: 560px) {
  .cn-setup { justify-content: center; }
  .cn-actions { width: 100%; justify-content: center; }
}

/* ---------- 동전 무대 ---------- */
.cn-stage {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 20px; min-height: 200px; padding: 32px 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);
  perspective: 700px;
}

.cn-coin {
  width: 84px; height: 84px;
}
.cn-coin-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transform: rotateY(0deg);
  transition: transform 1s cubic-bezier(0.25, 0.9, 0.3, 1);
}
.cn-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 900; font-size: 1.6rem;
  backface-visibility: hidden;
  box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.65), inset 0 -5px 10px rgba(0, 0, 0, 0.16), 0 8px 18px rgba(120, 140, 190, 0.35);
}
/* 앞: 금빛, 뒤: 은빛 */
.cn-front {
  background: radial-gradient(circle at 34% 28%, #ffe7a6, #f2c14e 60%, #d99a2b);
  color: #7a5316;
  border: 3px solid #e7b13e;
}
.cn-back {
  background: radial-gradient(circle at 34% 28%, #f2f4f8, #c9d0dc 60%, #a7b0bf);
  color: #4a5464;
  border: 3px solid #c2cad6;
  transform: rotateY(180deg);
}

/* ---------- 집계 ---------- */
.cn-tally {
  margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  animation: cn-fade 0.35s ease;
}
.cn-tally[hidden] { display: none; }
.cn-tally-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: 1rem;
}
.cn-tally-pill.is-front { background: linear-gradient(135deg, #ffe7a6, #f2c14e); color: #7a5316; }
.cn-tally-pill.is-back { background: linear-gradient(135deg, #eef1f6, #c9d0dc); color: #4a5464; }

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

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

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

@media (max-width: 560px) {
  .cn-coin { width: 68px; height: 68px; }
  .cn-face { font-size: 1.3rem; }
}

/* ---------- 다크 모드 ---------- */
@media (prefers-color-scheme: dark) {
  .cn-setup { background: #1e1f24; border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
  .cn-count-label { color: #eef1f6; }
  .cn-stepper { background: #17181c; border-color: rgba(255, 255, 255, 0.14); }
  .cn-step { color: #e8ebf2; }
  .cn-step:hover { background: rgba(255, 255, 255, 0.08); }
  .cn-count-input { color: #f0f2f6; }
  .cn-stage { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.3); }
  .cn-status { color: #9aa0aa; }
}
