/* ============================================================
   깨알도구
   룰렛 돌리기

   공통 레이아웃 / 패널 / 버튼 / 결과 / 안내 영역은
   tool-common.css 사용
   ============================================================ */

/* ============================================================
   PAGE
   ============================================================ */

.roulette-page {
  --tool-page-max-width: 920px;
}

/* ============================================================
   TEXTAREA
   ============================================================ */

.roulette-textarea {
  display: block;

  width: 100%;
  min-height: 220px;

  padding: 13px 14px;

  resize: vertical;

  border: 1px solid var(--line);
  border-radius: var(--tool-input-radius);

  background: #ffffff;

  color: var(--text);

  outline: none;

  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.75;

  box-sizing: border-box;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.roulette-textarea:focus {
  border-color: var(--accent);

  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.1);
}

.roulette-textarea:disabled {
  opacity: 0.65;

  background: var(--surface-soft);

  cursor: not-allowed;
}

/* ============================================================
   INPUT META
   ============================================================ */

.roulette-input-meta {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-top: 6px;

  color: var(--text-soft);

  font-size: var(--tool-help-size);
  line-height: 1.5;
}

.roulette-input-meta span:last-child {
  flex: 0 0 auto;

  font-variant-numeric: tabular-nums;
}

/* ============================================================
   CHECK
   ============================================================ */

.roulette-check {
  display: flex;

  align-items: center;

  gap: 10px;

  min-height: 58px;

  padding: 9px 11px;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: var(--surface-soft);

  cursor: pointer;

  box-sizing: border-box;
}

.roulette-check input {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;

  pointer-events: none;
}

.roulette-check-ui {
  position: relative;

  width: 36px;
  height: 20px;

  flex: 0 0 36px;

  border-radius: 999px;

  background: #d9d9d4;

  transition: background 0.18s ease;
}

.roulette-check-ui::after {
  content: '';

  position: absolute;

  top: 3px;
  left: 3px;

  width: 14px;
  height: 14px;

  border-radius: 50%;

  background: #ffffff;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);

  transition:
    left 0.18s ease,
    transform 0.18s ease;
}

.roulette-check input:checked + .roulette-check-ui {
  background: var(--brand);
}

.roulette-check input:checked + .roulette-check-ui::after {
  left: 19px;
}

.roulette-check input:focus-visible + .roulette-check-ui {
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.15);
}

.roulette-check input:disabled + .roulette-check-ui {
  opacity: 0.5;
}

.roulette-check-text {
  min-width: 0;
}

.roulette-check-text strong {
  display: block;

  color: var(--text);

  font-size: 12px;
  font-weight: 800;
}

.roulette-check-text small {
  display: block;

  margin-top: 2px;

  color: var(--text-soft);

  font-size: 12px;
  line-height: 1.45;
}

/* ============================================================
   OPTION LIST
   ============================================================ */

.roulette-option-list {
  display: flex;

  flex-wrap: wrap;

  gap: 6px;

  min-height: 36px;
}

.roulette-option-chip {
  max-width: 100%;

  display: inline-flex;

  align-items: center;

  gap: 5px;

  min-height: 30px;

  padding: 4px 8px;

  border: 1px solid var(--line);
  border-radius: 999px;

  background: #ffffff;

  color: var(--text);

  font-family: inherit;
  font-size: 12px;
  font-weight: 750;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.roulette-option-chip:hover:not(:disabled) {
  transform: translateY(-1px);

  background: var(--surface-soft);
}

.roulette-option-chip:disabled {
  opacity: 0.55;

  cursor: default;
}

.roulette-option-chip i {
  width: 8px;
  height: 8px;

  flex: 0 0 8px;

  border-radius: 50%;
}

.roulette-option-chip span {
  min-width: 0;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.roulette-option-chip b {
  flex: 0 0 auto;

  margin-left: 1px;

  color: var(--text-soft);

  font-size: 12px;
  line-height: 1;
}

.roulette-empty-list {
  width: 100%;

  padding: 14px 10px;

  border-radius: 9px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;
  line-height: 1.5;

  text-align: center;
}

/* ============================================================
   RESULT PANEL
   ============================================================ */

.roulette-result-panel {
  min-height: 0;

  justify-content: flex-start;
}

/* ============================================================
   STATUS
   ============================================================ */

.roulette-status {
  width: 100%;

  min-height: 34px;

  display: flex;

  align-items: center;
  justify-content: center;

  margin-bottom: 10px;

  padding: 7px 10px;

  border-radius: 9px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;

  text-align: center;

  box-sizing: border-box;
}

.roulette-status.is-error {
  background: #fff3ef;

  color: #a24b3b;
}

.roulette-status.is-spinning {
  color: var(--text);

  font-weight: 800;
}

/* ============================================================
   ROULETTE STAGE
   ============================================================ */

.roulette-stage {
  position: relative;

  width: min(100%, 390px);

  margin: 0 auto;

  aspect-ratio: 1 / 1;

  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   CANVAS
   ============================================================ */

#rouletteCanvas {
  display: block;

  width: 100%;
  height: 100%;

  border-radius: 50%;

  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.12));
}

/* ============================================================
   POINTER
   ============================================================ */

.roulette-pointer {
  position: absolute;

  z-index: 5;

  top: -2px;
  left: 50%;

  width: 0;
  height: 0;

  transform: translateX(-50%);

  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 27px solid #171d2b;

  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));

  pointer-events: none;
}

/* ============================================================
   CENTER BUTTON
   ============================================================ */

.roulette-center-button {
  position: absolute;

  z-index: 6;

  top: 50%;
  left: 50%;

  width: 78px;
  height: 78px;

  transform: translate(-50%, -50%);

  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  border: 6px solid #ffffff;
  border-radius: 50%;

  background: #171d2b;

  color: #ffffff;

  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);

  font-family: inherit;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    box-shadow 0.15s ease;
}

.roulette-center-button:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.04);

  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.27);
}

.roulette-center-button:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.97);
}

.roulette-center-button:disabled {
  opacity: 0.45;

  cursor: not-allowed;
}

.roulette-center-button span {
  display: block;

  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.roulette-center-button small {
  display: block;

  margin-top: 1px;

  opacity: 0.65;

  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
   SPINNING
   ============================================================ */

.roulette-stage.is-spinning .roulette-center-button {
  pointer-events: none;
}

.roulette-stage.is-spinning #rouletteCanvas {
  filter: drop-shadow(0 14px 23px rgba(0, 0, 0, 0.16));
}

/* ============================================================
   RESULT
   ============================================================ */

.roulette-result-content {
  margin-top: 15px;

  padding-top: 15px;

  border-top: 1px solid var(--line);

  text-align: center;
}

.roulette-result-content[hidden] {
  display: none;
}

.roulette-result-content .tool-result-main strong {
  margin-top: 2px;

  font-size: 27px;

  overflow-wrap: anywhere;
}

.roulette-result-actions {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 7px;

  margin-top: 14px;
}

.roulette-result-actions .tool-result-action {
  width: 100%;
}

/* ============================================================
   MINI GUIDE
   ============================================================ */

.roulette-mini-guide {
  width: 100%;

  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 5px;

  margin-top: 14px;
}

.roulette-mini-guide > div {
  min-width: 0;

  padding: 7px 4px;

  border-radius: 8px;

  background: var(--surface-soft);

  text-align: center;
}

.roulette-mini-guide strong {
  display: block;

  color: var(--text);

  font-size: 12px;
  font-weight: 850;
}

.roulette-mini-guide span {
  display: block;

  margin-top: 2px;

  color: var(--text-soft);

  font-size: 12px;
  line-height: 1.35;
}

/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 760px) {
  .roulette-result-panel {
    order: -1;
  }

  .roulette-stage {
    width: min(100%, 370px);
  }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 520px) {
  .roulette-textarea {
    min-height: 190px;

    font-size: 12px;
  }

  .roulette-stage {
    width: min(100%, 340px);
  }

  .roulette-center-button {
    width: 68px;
    height: 68px;

    border-width: 5px;
  }

  .roulette-center-button span {
    font-size: 13px;
  }

  .roulette-pointer {
    border-left-width: 11px;
    border-right-width: 11px;
    border-top-width: 23px;
  }

  .roulette-result-actions {
    grid-template-columns: 1fr;
  }

  .roulette-mini-guide {
    gap: 4px;
  }

  .roulette-mini-guide > div {
    padding: 6px 2px;
  }
}

.quick-random label{display:block;font-weight:700;margin:14px 0 6px}.quick-random input,.quick-random select,.quick-random textarea{box-sizing:border-box;width:100%;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);color:inherit;font:inherit}.quick-random pre{white-space:pre-wrap;overflow-wrap:anywhere}.quick-random [hidden]{display:none}
