/* /var/www/html/assets/css/game-tools.css
   랜덤·게임 도구 공통 스타일 (랜덤 숫자 뽑기 / 가위바위보).
   style.css 다크 테마 위에 얹으며, 랜덤 카테고리 포인트색(lavender) 계열을 쓴다. */

.gm-page {
  --gm: #b9aef2;
  --gm-soft: rgba(185, 174, 242, 0.16);
  --ok: #8fe0a8;
  --bad: #f0a3a3;
}

.gm-tool {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 8px 0 34px;
}

/* 입력/설정 카드 */
.gm-card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.gm-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.gm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.gm-field label {
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(245, 245, 242, 0.82);
}

.gm-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gm-input:focus {
  outline: none;
  border-color: var(--gm);
  background: rgba(255, 255, 255, 0.06);
}

.gm-input.is-invalid {
  border-color: var(--bad);
  background: rgba(214, 96, 96, 0.08);
}

/* 옵션(체크박스) 줄 — text-tools의 .tt-check 톤을 독립적으로 재현 */
.gm-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.gm-check {
  position: relative;
  display: inline-flex;
}

.gm-check input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.gm-check > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 245, 242, 0.82);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gm-check > span::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 245, 242, 0.4);
  background: transparent center / 11px 11px no-repeat;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gm-check input:hover:not(:checked) + span {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.gm-check input:checked + span {
  background: #f5f5f2;
  border-color: #f5f5f2;
  color: #141414;
}

.gm-check input:checked + span::before {
  border-color: #141414;
  background-color: #141414;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}

.gm-check input:focus-visible + span {
  outline: 2px solid #8ab4ff;
  outline-offset: 2px;
}

.gm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.gm-note {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: rgba(245, 245, 242, 0.6);
}

.gm-note.is-ok { color: var(--ok); }
.gm-note.is-error { color: var(--bad); }

/* 결과 무대 */
.gm-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120px at 50% 0%, var(--gm-soft), transparent 70%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  text-align: center;
  min-height: 150px;
  justify-content: center;
}

.gm-empty {
  color: rgba(245, 245, 242, 0.5);
  font-size: 0.96rem;
}

/* 뽑힌 숫자 칩 목록 */
.gm-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.gm-chip {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  background: #f5f5f2;
  color: #141414;
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  animation: gm-pop 0.28s ease both;
}

@keyframes gm-pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 가위바위보 선택 버튼 */
.gm-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gm-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.gm-choice:hover {
  transform: translateY(-2px);
  border-color: var(--gm);
  background: var(--gm-soft);
}

.gm-choice .gm-choice-mark {
  font-size: 1.9rem;
  line-height: 1;
}

.gm-choice:focus-visible {
  outline: 2px solid #8ab4ff;
  outline-offset: 2px;
}

/* 가위바위보 대결 표시 */
.gm-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
}

.gm-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gm-hand-mark {
  font-size: 2.6rem;
  line-height: 1;
}

.gm-hand-label {
  font-size: 0.86rem;
  color: rgba(245, 245, 242, 0.62);
}

.gm-vs {
  font-size: 0.9rem;
  font-weight: 800;
  color: rgba(245, 245, 242, 0.5);
}

.gm-outcome {
  font-size: 1.9rem;
  font-weight: 800;
}

.gm-outcome.win { color: var(--ok); }
.gm-outcome.lose { color: var(--bad); }
.gm-outcome.draw { color: rgba(245, 245, 242, 0.82); }

/* 전적 */
.gm-record {
  display: flex;
  gap: 18px;
  color: rgba(245, 245, 242, 0.7);
  font-size: 0.92rem;
}

.gm-record b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 안내 영역 (사용법/FAQ) */
.gm-guide {
  margin: 34px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.gm-guide h2 { margin: 0 0 14px; font-size: 1.3rem; }
.gm-guide h3 { margin: 18px 0 6px; font-size: 1.02rem; }
.gm-guide p, .gm-guide li { color: rgba(245, 245, 242, 0.72); line-height: 1.7; }
.gm-guide ol, .gm-guide ul { margin: 0; padding-left: 20px; }
.gm-guide li + li { margin-top: 6px; }
.gm-guide p { margin: 0 0 8px; }

@media (max-width: 560px) {
  .gm-card, .gm-stage { padding: 18px 16px; }
  .gm-hand-mark { font-size: 2.1rem; }
  .gm-outcome { font-size: 1.6rem; }
}

/* ---------- 돌림판 룰렛 ---------- */
.wheel-area {
  display: grid;
  grid-template-columns: minmax(0, 300px) 1fr;
  gap: 24px;
  align-items: start;
}

.wheel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #f5f5f2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  background: #333;
  transition: transform 4.2s cubic-bezier(0.16, 0.84, 0.24, 1);
  will-change: transform;
}

.wheel-pointer {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid #f5f5f2;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
  z-index: 2;
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #f5f5f2;
  border: 3px solid #141414;
  z-index: 2;
}

.wheel-result {
  min-height: 1.6em;
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gm);
}

.wheel-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wheel-input {
  width: 100%;
  min-height: 160px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.7;
  resize: vertical;
}
.wheel-input:focus { outline: none; border-color: var(--gm); }

.wheel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wheel-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  color: rgba(245, 245, 242, 0.82);
}
.wheel-tag::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--c, #888);
}
.wheel-tag.is-winner {
  background: #f5f5f2;
  color: #141414;
  border-color: #f5f5f2;
  font-weight: 800;
}

@media (max-width: 640px) {
  .wheel-area { grid-template-columns: 1fr; }
}
