/* ===== ルーレット画面 ===== */

/* ルーレット専用の色変数 */
:root {
  --roulette-accent: #ff6678;
  --roulette-accent-strong: #ff5065;
  --roulette-accent-soft: rgba(255, 102, 120, 0.32);
  --roulette-accent-soft-strong: rgba(255, 102, 120, 0.24);
  --roulette-shadow-accent: 0 12px 26px rgba(255, 102, 120, 0.32);
  --roulette-shadow-accent-strong: 0 6px 14px rgba(255, 102, 120, 0.24);
}

/* レイアウト */

main.roulette {
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
}

.roulette__section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0px 28px;
  background: var(--color-surface);
}

/* レスポンシブ調整（モバイル） */

@media (max-width: 360px) {
  main.roulette {
    padding: 12px;
  }
}

/* セクションの表示制御 */

.roulette__section--wheel {
  display: flex;
}

.roulette__section--wheel[hidden] {
  display: none;
}

/* エディター */

/* エディターセクション内の要素間隔を調整 */
.roulette__section--editor {
  gap: 4px;
  position: relative;
}

.editor__heading {
  font-size: 18px;
  font-weight: 700;
}

/* 入力フォーム */

.editor__form {
  margin: 0;
}

.editor__input-row {
  display: flex;
  margin-bottom: 16px;
  align-items: stretch;
  gap: 8px;
}

.editor__input {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-alt);
  transition: border var(--transition-base), box-shadow var(--transition-base);
}

.editor__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.editor__input::placeholder {
  color: var(--color-text-muted);
}

.editor__add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-raised);
}

.editor__add-button:hover {
  background: var(--color-primary-strong);
}

.editor__add-button:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-raised);
}

/* 選択肢リスト */

.editor__options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editor__subheading {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.editor__option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor__option-list > li,
.editor__option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.editor__option-label {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-word;
}

.editor__option-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.editor__option-action {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  border: 1px solid transparent;
  background: var(--color-surface-alt);
  color: inherit;
  font-size: 14px;
}

.editor__option-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-button);
}

.editor__option-action:active {
  transform: translateY(0);
  box-shadow: none;
}

.editor__option-action--delete {
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border-color: rgba(255, 122, 138, 0.24);
}

/* エラーメッセージ */

.editor__error-message {
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--color-danger-soft);
  border: 1px solid rgba(255, 122, 138, 0.24);
  color: var(--color-danger);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}

/* 確定ボタン */

.editor__confirm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-raised);
  margin-top: 16px;
}

.editor__confirm-button:hover {
  background: var(--color-primary-strong);
}

.editor__confirm-button:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-raised);
}

/* ルーレット本体 */

.wheel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.wheel__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  width: min(100%, 400px);
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  /* border: 12px solid var(--color-surface-alt); */
  /* background: var(--color-surface); */
  /* box-shadow: var(--shadow-soft); */
}

/* 矢印の外枠（白い三角形） */
.wheel__pointer {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 27px solid #ffffff;
  z-index: 1;
}

/* 矢印の内側（赤い三角形） */
.wheel__pointer::before {
  content: '';
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 25px solid var(--roulette-accent);
  z-index: 2;
}

.wheel__canvas {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform var(--transition-slow);
}

.wheel__labels {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 操作用ボタン */

.wheel__start-button {
  align-self: center;
  padding: 16px 64px;
  border-radius: var(--radius-pill);
  background: var(--roulette-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-raised);
}

.wheel__start-button:hover {
  background: var(--roulette-accent-strong);
}

.wheel__start-button:active {
  transform: translateY(1px);
  box-shadow: var(--roulette-shadow-accent-strong);
}

.wheel__start-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 結果表示 */

.wheel__result {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 500;
  color: var(--color-text);
}

.wheel__result-label {
  font-weight: 700;
}

/* 追加アクション */

.wheel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.wheel__action-button {
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
}

.wheel__action-button:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

.wheel__action-button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.wheel__action-button--reset,
.wheel__action-button--back {
  color: var(--color-primary);
  background: var(--color-surface);
  border-color: var(--color-primary);
}

.wheel__action-button--reset:hover,
.wheel__action-button--back:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
}
