/* /var/www/html/assets/css/marble.css : 구슬 레이스(핀볼 추첨) 도구 전용 스타일 (파스텔 톤).
   사다리 게임(ladder.css)과 같은 톤/컴포넌트 언어를 공유한다. */

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

/* ---------- 상단 설정 바 ---------- */
.mr-setup {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  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;
}
.mr-count { justify-self: start; }
.mr-course { justify-self: center; }
.mr-actions { justify-self: end; }

.mr-count {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.mr-count-label,
.mr-course-label {
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
}
.mr-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;
}
.mr-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;
}
.mr-step:hover { background: rgba(0, 0, 0, 0.06); }
.mr-step:active { transform: scale(0.9); }
.mr-step:disabled { opacity: 0.3; cursor: not-allowed; }

.mr-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;
}
.mr-count-input::-webkit-outer-spin-button,
.mr-count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mr-count-input:focus { outline: none; }

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

.mr-actions { display: flex; }
.mr-actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.mr-actions-group[hidden] { display: none; }

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

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

/* ---------- 참가자 이름 칩 ---------- */
.mr-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.mr-name {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  box-shadow: 0 3px 9px rgba(150, 160, 190, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.mr-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.15);
}
.mr-chip {
  width: 108px;
  max-width: 40vw;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 0;
}
.mr-chip::placeholder { color: rgba(60, 60, 80, 0.42); font-weight: 600; }
.mr-chip:focus { outline: none; }

/* ---------- 경기장 보드 ---------- */
.mr-board {
  position: relative;
  background:
    radial-gradient(120% 70% 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;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 12px 32px rgba(150, 170, 210, 0.14);
}
.mr-canvas-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
#mr-canvas {
  display: block;
  width: 100%;
  height: 560px;
  touch-action: manipulation;
}

/* 인라인 "바로 결과 보기" */
.mr-skip {
  display: block;
  margin: 12px auto 0;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #2f3a4d;
  background: linear-gradient(135deg, #9cd3ef, #b9b3ee);
  box-shadow: 0 4px 14px rgba(150, 175, 225, 0.4);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease;
}
.mr-skip[hidden] { display: none; }
.mr-skip:hover { filter: brightness(1.05); transform: translateY(-1px); }
.mr-skip:active { transform: scale(0.97); }

/* 시작 전 가림막 */
.mr-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  background: rgba(200, 214, 240, 0.16);
  backdrop-filter: blur(3px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.mr-cover.is-hidden { opacity: 0; visibility: hidden; }

/* 순수 CSS 구슬 아이콘 */
.mr-cover-mark {
  position: relative;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #cbe8fb 0 18%, #9cd3ef 45%, #7bb6e0 100%);
  box-shadow: 0 6px 16px rgba(120, 160, 210, 0.5);
}
.mr-cover-mark::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.mr-cover-title { font-weight: 800; font-size: 1rem; margin: 0; }
.mr-cover-sub { font-size: 0.85rem; color: #7a8296; margin: 0; }

.mr-quick-btn {
  margin-top: 12px;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #2f3a4d;
  background: linear-gradient(135deg, #9cd3ef, #b9b3ee);
  box-shadow: 0 4px 14px rgba(150, 175, 225, 0.45);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease;
}
.mr-quick-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.mr-quick-btn:active { transform: scale(0.97); }

/* 우측 하단 플로팅 */
.mr-skip-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #2f3a4d;
  background: linear-gradient(135deg, #9cd3ef, #b9b3ee);
  box-shadow: 0 10px 26px rgba(90, 110, 160, 0.4);
  cursor: pointer;
  animation: mr-fade 0.25s ease;
}
.mr-skip-float[hidden] { display: none; }
.mr-skip-float:hover { filter: brightness(1.05); }
.mr-skip-float:active { transform: scale(0.97); }

/* ---------- 결과 배너 ---------- */
.mr-banner {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mr-banner[hidden] { display: none; }

.mr-result-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(200, 214, 240, 0.18);
  border: 1px solid rgba(142, 160, 210, 0.24);
  font-size: 0.9rem;
  font-weight: 600;
  animation: mr-fade 0.35s ease;
}
.mr-result-pill.is-first {
  background: linear-gradient(135deg, #ffe6b8, #ffd0dd);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(240, 190, 150, 0.4);
}
.mr-result-pill .mr-rank { font-weight: 800; color: #5a6478; }
.mr-result-pill.is-first .mr-rank { color: #a6612a; }
.mr-result-pill .mr-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mr-result-pill .mr-name-txt { font-weight: 700; }

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

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

/* ---------- 모달 ---------- */
.mr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mr-modal[hidden] { display: none; }
.mr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 26, 38, 0.5);
  backdrop-filter: blur(3px);
}
.mr-modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  color: #1c1e26;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  animation: mr-fade 0.25s ease;
}
.mr-modal-body {
  overflow-y: auto;
  padding: 30px 24px 24px;
}
.mr-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 22, 30, 0.06);
  color: #4a4a58;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.mr-modal-close:hover { background: rgba(20, 22, 30, 0.12); color: #14161a; }
.mr-modal-close:active { transform: scale(0.92); }

/* 한 번에 입력 */
.mr-qe-head { text-align: center; margin-bottom: 16px; }
.mr-qe-title { font-weight: 800; font-size: 1.2rem; margin: 0; }
.mr-qe-progress { font-size: 0.85rem; color: #8a92a4; margin: 4px 0 0; }
.mr-qe-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.mr-qe-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}
.mr-qe-cellinput {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid #d7dceb;
  background: #f7f9fc;
  color: #1c1e26;
  font-weight: 600;
}
.mr-qe-cellinput:focus { outline: none; border-color: #9cc7ef; background: #fff; }
.mr-qe-tool {
  flex: none;
  border: 1px solid rgba(142, 160, 210, 0.3);
  background: #fff;
  color: #5a6478;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.mr-qe-tool:hover { background: linear-gradient(135deg, #bde3f4, #d9d4f5); color: #2f3a4d; }
.mr-qe-tool:active { transform: scale(0.95); }
.mr-qe-status {
  text-align: center;
  font-size: 0.78rem;
  color: #8a92a4;
  min-height: 1.1em;
  margin-top: 10px;
}
.mr-qe-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.mr-qe-actions .btn {
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 700;
  border: 1px solid rgba(142, 160, 210, 0.28);
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.08s ease;
}
.mr-qe-actions .btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.mr-qe-actions .btn-primary {
  background-image: linear-gradient(135deg, #9cd3ef, #b9b3ee);
  border: none;
  color: #2f3a4d;
  box-shadow: 0 4px 14px rgba(150, 175, 225, 0.4);
}

/* 결과 순위 */
.mr-res-title { text-align: center; font-weight: 800; font-size: 1.25rem; margin: 0 0 16px; }
.mr-res-list { display: flex; flex-direction: column; gap: 8px; }
.mr-res-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(200, 214, 240, 0.18);
  border: 1px solid rgba(142, 160, 210, 0.2);
  font-size: 0.95rem;
}
.mr-res-row.is-first {
  background: linear-gradient(135deg, #ffe6b8, #ffd0dd);
  border-color: transparent;
}
.mr-res-row .mr-res-rank { font-weight: 800; color: #5a6478; min-width: 34px; }
.mr-res-row.is-first .mr-res-rank { color: #a6612a; }
.mr-res-row .mr-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; }
.mr-res-row .mr-res-name { font-weight: 700; }

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

/* ---------- 모바일 ---------- */
@media (max-width: 560px) {
  .mr-actions { width: 100%; justify-content: center; }
  #mr-canvas { height: 460px; }
  .mr-chip { width: 84px; }
}

/* ---------- 다크 모드 ---------- */
@media (prefers-color-scheme: dark) {
  .mr-setup { background: #1e1f24; border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
  .mr-count-label, .mr-course-label { color: #eef1f6; }
  .mr-stepper, .mr-course-btns { background: #17181c; border-color: rgba(255, 255, 255, 0.14); }
  .mr-step { color: #e8ebf2; }
  .mr-step:hover { background: rgba(255, 255, 255, 0.08); }
  .mr-count-input { color: #f0f2f6; }
  .mr-course-btn { color: #c3c9d4; }
  .mr-course-btn:hover { background: rgba(255, 255, 255, 0.08); }
  .mr-board { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.3); }
  .mr-status { color: #9aa0aa; }
  .mr-cover-sub { color: #8b93a5; }
  .mr-modal-card { background: #23242b; color: #e8ebf2; }
  .mr-modal-close { background: rgba(255, 255, 255, 0.1); color: #cdd2dc; }
  .mr-modal-close:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
  .mr-qe-cellinput { background: #17181c; color: #e8ebf2; border-color: rgba(255, 255, 255, 0.18); }
  .mr-qe-cellinput:focus { background: #1c1d22; border-color: #6f9fd0; }
  .mr-qe-tool { background: rgba(255, 255, 255, 0.08); color: #cdd2dc; border-color: rgba(255, 255, 255, 0.16); }
  .mr-qe-tool:hover { color: #1a1a1e; }
  .mr-res-row { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
  .mr-res-row.is-first { background: linear-gradient(135deg, #6a5636, #6a3f4c); }
  .mr-res-row.is-first .mr-res-rank { color: #ffd9a6; }
  .mr-result-pill { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
  .mr-result-pill.is-first { background: linear-gradient(135deg, #6a5636, #6a3f4c); }
  .mr-result-pill.is-first .mr-rank { color: #ffd9a6; }
}
