/**
 * Web Roulette Plugin Styles
 */

 :root {
  /* メインカラーと背景設定 */
  --wr-bg-main: #46757e;
  --wr-bg-card: #ebebeb;
  
  /* テキストカラー */
  --wr-text-main: #333333;      /* タイトル・説明文に使用 */
  --wr-text-muted: #666666;
  
  /* アクセント・状態 */
  --wr-accent-primary: #46757e;
  --wr-accent-hover: #5a8e99;
  --wr-danger: #ff4b5c;         /* 矢印・削除ボタン */
  
  /* 装飾要素 */
  --wr-radius-lg: 24px;
  --wr-radius-md: 16px;
  --wr-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
  --wr-shadow-md: 0 10px 24px rgba(0, 0, 0, 0.12);
  --wr-transition: all 0.2s ease;
}

/* -----------------------------
   全体コンテナ
----------------------------- */
.wr-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 16px;
  background: var(--wr-bg-main); /* アプリ全体の背景 */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--wr-text-main);
  line-height: 1.6;
}

.wr-app *, .wr-app *::before, .wr-app *::after {
  box-sizing: border-box;
}

/* -----------------------------
   ヘッダー（タイトル・説明文）
----------------------------- */
.wr-header {
  text-align: center;
  margin-bottom: 40px;
}

.wr-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  color: var(--wr-text-main) !important; /* 指定：文字色変更 */
}

.wr-desc-card {
  display: inline-block;
  text-align: left;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 28px;
  border-radius: var(--wr-radius-md);
  box-shadow: var(--wr-shadow-sm);
  font-size: 14px;
  max-width: 700px;
  color: var(--wr-text-main) !important; /* 指定：文字色変更 */
}

.wr-desc-card p {
  margin: 0 0 8px;
}

.wr-desc-card p:last-child {
  margin-bottom: 0;
}

/* -----------------------------
   メインレイアウト（元の flex 仕様）
----------------------------- */
main.wr-main {
  display: flex;
  gap: 56px; /* 元の仕様通りの広い余白 */
  align-items: flex-start;
}

.wr-left, .wr-right {
  flex: 1 1 0;
  min-width: 0;
}

.wr-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* -----------------------------
   左側：ルーレットカード
----------------------------- */
.wr-wheel-card {
  background: var(--wr-bg-card);
  border-radius: var(--wr-radius-lg);
  padding: 40px 32px;
  box-shadow: var(--wr-shadow-md);
}

.wr-wheel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wr-wheel-wrapper {
  position: relative;
  width: 320px;
  margin: 20px auto 30px; /* 矢印とボタンの間の余白 */
}

.wr-wheel-wrapper canvas {
  width: 100%;
  height: auto;
  border-radius: 50%;
  border: 10px solid #333333;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.2);
  background: #ffffff;
}

/* 改良された下向き矢印 */
.wr-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 32px solid var(--wr-danger);
  z-index: 10;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
}

.wr-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 56px;
  border-radius: 999px;
  border: none;
  background: #111111;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--wr-transition);
  box-shadow: 0 6px 0 #444444;
}

.wr-start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #444444;
}

.wr-start-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #444444;
}

.wr-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 結果表示エリア */
.wr-result-area {
  margin-top: 32px;
}

.wr-result-card {
  background: #ffffff;
  border-radius: var(--wr-radius-md);
  padding: 24px;
  border: 2px dashed #d0b69b;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wr-result-label {
  display: block;
  font-size: 12px;
  color: var(--wr-text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wr-result-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--wr-accent-primary);
}

/* -----------------------------
   右側：パネル設定
----------------------------- */
.wr-panel {
  background: #ffffff;
  border-radius: var(--wr-radius-md);
  padding: 24px;
  box-shadow: var(--wr-shadow-sm);
}

.wr-panel-title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  border-left: 5px solid var(--wr-accent-primary);
  padding-left: 12px;
}

/* 項目リスト */
.wr-items-container {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding-right: 4px;
}

.wr-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wr-item-input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #e0d0b8;
  background: #fdfcfb;
  font-size: 14px;
  transition: var(--wr-transition);
}

.wr-item-input:focus {
  outline: none;
  border-color: var(--wr-accent-primary);
  box-shadow: 0 0 0 3px rgba(70, 117, 126, 0.1);
}

.wr-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.wr-delete-btn {
  background: none;
  border: none;
  color: #cccccc;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  transition: var(--wr-transition);
}

.wr-delete-btn:hover {
  color: var(--wr-danger);
}

/* 項目操作ボタン */
.wr-items-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wr-outline-btn {
  background: var(--wr-accent-primary);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--wr-transition);
}

.wr-outline-btn:hover {
  background: var(--wr-accent-hover);
}

.wr-text-btn {
  background: transparent;
  border: none;
  color: var(--wr-text-muted);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
}

/* 各種設定フィールド */
.wr-field {
  margin-bottom: 20px;
}

.wr-field:last-child {
  margin-bottom: 0;
}

.wr-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--wr-text-muted);
}

.wr-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e0d0b8;
  background: #fdfcfb;
}

.wr-range {
  width: 100%;
  accent-color: var(--wr-accent-primary);
  cursor: pointer;
}

/* -----------------------------
   レスポンシブ
----------------------------- */
@media (max-width: 900px) {
  main.wr-main {
    flex-direction: column;
    gap: 32px;
  }
  
  .wr-wheel-wrapper {
    width: 280px;
  }
  
  .wr-items-container {
    max-height: none;
  }
}