/* odai.css - お題ジェネレーター */

/* ── レイアウト ── */
.odai-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}

/* ── カテゴリタブ ── */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.category-tab .tab-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.category-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--card-bg));
  transform: translateY(-1px);
}

.category-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

/* ── メイン表示カード ── */
.odai-main-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl, 1rem);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.5rem;
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

/* カテゴリ名バッジ */
.odai-category-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* お題テキスト */
.odai-text {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.3;
  word-break: break-word;
  animation: odai-appear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.odai-text.wolfword {
  font-size: clamp(1.1rem, 3.5vw, 1.8rem);
}

@keyframes odai-appear {
  from {
    opacity: 0;
    transform: scale(0.75) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 残り枚数 */
.odai-remaining {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── コントロール ── */
.odai-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.btn-next-odai {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  font-size: 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
  transition: all 0.15s ease;
  min-width: 220px;
}

.btn-next-odai:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-next-odai:active {
  transform: scale(0.96);
}

.btn-next-odai:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.odai-sub-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── 履歴カード ── */
.odai-history-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.odai-history-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.odai-history-toggle:hover {
  background: var(--bg-muted);
  transform: none;
  box-shadow: none;
}

.odai-history-toggle .chevron {
  transition: transform 0.2s ease;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.odai-history-toggle.open .chevron {
  transform: rotate(180deg);
}

.odai-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border-color);
  max-height: 300px;
  overflow-y: auto;
}

.odai-history-list.hidden {
  display: none;
}

.odai-history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  animation: fade-in-left 0.2s ease;
}

.odai-history-item:last-child {
  border-bottom: none;
}

.odai-history-item .hist-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 1.5rem;
  flex-shrink: 0;
}

.odai-history-item .hist-cat {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-muted);
  flex-shrink: 0;
}

.odai-history-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── ヒントバッジ（カテゴリ説明） ── */
.odai-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
