/**
 * お題ジェネレーター - 専用スタイル
 */

/* ===== カテゴリタブ ===== */
.od-category-tabs {
	display: flex;
	border-bottom: 1px solid var(--color-border);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.od-category-tab {
	flex: 1;
	min-width: 0;
	padding: 12px 8px;
	font-size: 13px;
	font-weight: 500;
	font-family: var(--font-body);
	color: var(--color-text-muted);
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}

.od-category-tab:hover {
	color: var(--color-text);
	background: var(--color-bg);
}

.od-category-tab.active {
	font-weight: 700;
}

.od-category-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	font-size: 16px;
	font-weight: 700;
	border-radius: 50%;
	color: var(--color-white);
	transition: transform 0.2s;
}

.od-category-tab.active .od-category-icon {
	transform: scale(1.1);
}

.od-category-name {
	font-size: 11px;
	line-height: 1.2;
}

/* カテゴリカラー */
.od-cat-illustration .od-category-icon { background: #FF6B6B; }
.od-cat-illustration.active { color: #FF6B6B; border-bottom-color: #FF6B6B; }

.od-cat-novel .od-category-icon { background: #6C5CE7; }
.od-cat-novel.active { color: #6C5CE7; border-bottom-color: #6C5CE7; }

.od-cat-oogiri .od-category-icon { background: #F39C12; }
.od-cat-oogiri.active { color: #F39C12; border-bottom-color: #F39C12; }

.od-cat-conversation .od-category-icon { background: #00B894; }
.od-cat-conversation.active { color: #00B894; border-bottom-color: #00B894; }

.od-cat-game .od-category-icon { background: #0984E3; }
.od-cat-game.active { color: #0984E3; border-bottom-color: #0984E3; }

/* ===== サブジャンルチップス ===== */
.od-subgenre-section {
	padding: 12px 20px;
	border-bottom: 1px solid var(--color-border);
	background: var(--color-bg);
}

.od-subgenre-chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 4px;
}

.od-subgenre-chip {
	flex-shrink: 0;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 500;
	font-family: var(--font-body);
	color: var(--color-text-secondary);
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s;
	white-space: nowrap;
}

.od-subgenre-chip:hover {
	border-color: var(--color-text-muted);
}

.od-subgenre-chip.active {
	color: var(--color-white);
	border-color: transparent;
}

/* サブジャンルのアクティブカラー（カテゴリに連動） */
.od-subgenre-chips[data-category="illustration"] .od-subgenre-chip.active { background: #FF6B6B; }
.od-subgenre-chips[data-category="novel"] .od-subgenre-chip.active { background: #6C5CE7; }
.od-subgenre-chips[data-category="oogiri"] .od-subgenre-chip.active { background: #F39C12; }
.od-subgenre-chips[data-category="conversation"] .od-subgenre-chip.active { background: #00B894; }
.od-subgenre-chips[data-category="game"] .od-subgenre-chip.active { background: #0984E3; }

/* ===== ガチャ表示エリア ===== */
.od-gacha-area {
	padding: 32px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid var(--color-border);
	background: var(--color-bg);
}

.od-gacha-display {
	width: 100%;
	max-width: 480px;
}

.od-gacha-frame {
	position: relative;
	width: 100%;
	min-height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-white);
	border: 2px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: border-color 0.3s, box-shadow 0.3s;
}

.od-gacha-frame.spinning {
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.1);
	animation: odPulse 0.6s ease-in-out infinite;
}

.od-gacha-frame.result {
	box-shadow: 0 0 0 3px rgba(224, 120, 80, 0.15);
}

.od-gacha-text {
	padding: 24px 20px;
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 700;
	color: var(--color-primary-dark);
	text-align: center;
	line-height: 1.6;
	user-select: none;
	word-break: break-word;
}

.od-gacha-text.spinning {
	animation: slotShuffle 0.06s steps(1) infinite;
}

.od-gacha-text.result {
	animation: odBounceIn 0.5s ease-out;
}

.od-gacha-indicator {
	font-size: 13px;
	color: var(--color-text-muted);
	min-height: 20px;
	text-align: center;
}

/* ===== 結果カード ===== */
.od-result-card {
	padding: 16px 20px;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: flex-start;
	gap: 14px;
	animation: odFadeIn 0.3s ease-out;
}

.od-result-color-bar {
	flex-shrink: 0;
	width: 4px;
	min-height: 48px;
	border-radius: 2px;
	align-self: stretch;
}

.od-result-body {
	flex: 1;
	min-width: 0;
}

.od-result-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.od-result-category-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	font-size: 12px;
	font-weight: 700;
	color: var(--color-white);
	border-radius: 50%;
}

.od-result-category-name {
	font-family: var(--font-display);
	font-size: 12px;
	font-weight: 700;
	color: var(--color-text-secondary);
}

.od-result-subgenre {
	font-size: 12px;
	color: var(--color-text-muted);
}

.od-result-topic {
	font-size: 15px;
	font-weight: 500;
	color: var(--color-text);
	line-height: 1.6;
	word-break: break-word;
}

.od-result-actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.od-action-btn {
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 500;
	font-family: var(--font-body);
	color: var(--color-text-secondary);
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s;
	white-space: nowrap;
}

.od-action-btn:hover {
	background: var(--color-white);
	border-color: var(--color-text-muted);
}

/* ===== ガチャボタン ===== */
.od-gacha-btn {
	display: block;
	width: 100%;
	max-width: 320px;
	margin: 0 auto;
	padding: 14px 24px;
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 700;
	color: var(--color-white);
	background: linear-gradient(135deg, #FF6347, #FF8C00);
	border: none;
	border-radius: var(--radius);
	cursor: pointer;
	transition: opacity 0.2s, transform 0.1s;
}

.od-gacha-btn:hover {
	opacity: 0.9;
}

.od-gacha-btn:active {
	transform: scale(0.98);
}

.od-gacha-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* ===== 履歴 ===== */
.od-history-section {
	padding: 14px 20px;
	border-bottom: 1px solid var(--color-border);
}

.od-history-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.od-history-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.od-history-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	font-size: 13px;
	color: var(--color-text-secondary);
	line-height: 1.5;
}

.od-history-item + .od-history-item {
	border-top: 1px solid var(--color-border);
}

.od-history-num {
	flex-shrink: 0;
	font-family: var(--font-display);
	font-size: 12px;
	color: var(--color-text-muted);
}

.od-history-badge {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	font-size: 10px;
	font-weight: 700;
	color: var(--color-white);
	border-radius: 50%;
}

.od-history-text {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ===== アクションセクション ===== */
.od-action-section {
	padding: 20px;
	display: flex;
	justify-content: center;
}

/* ===== アニメーション ===== */
@keyframes odPulse {
	0%, 100% { box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.1); }
	50% { box-shadow: 0 0 0 6px rgba(61, 90, 128, 0.05); }
}

@keyframes odBounceIn {
	0% { transform: scale(0.8); opacity: 0; }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); opacity: 1; }
}

@keyframes odFadeIn {
	0% { opacity: 0; transform: translateY(-8px); }
	100% { opacity: 1; transform: translateY(0); }
}

@keyframes slotShuffle {
	0% { opacity: 1; }
	50% { opacity: 0.7; }
	100% { opacity: 1; }
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
	.od-category-tabs {
		gap: 0;
	}

	.od-category-tab {
		padding: 10px 6px;
		font-size: 12px;
	}

	.od-category-icon {
		width: 28px;
		height: 28px;
		font-size: 14px;
	}

	.od-category-name {
		font-size: 10px;
	}

	.od-subgenre-section {
		padding: 10px 16px;
	}

	.od-subgenre-chip {
		padding: 5px 12px;
		font-size: 12px;
	}

	.od-gacha-area {
		padding: 24px 16px;
	}

	.od-gacha-text {
		font-size: 17px;
		padding: 20px 16px;
	}

	.od-result-card {
		padding: 14px 16px;
	}

	.od-result-actions {
		gap: 6px;
	}

	.od-action-btn {
		padding: 5px 10px;
		font-size: 11px;
	}

	.od-gacha-btn {
		font-size: 15px;
		padding: 12px 20px;
	}

	.od-action-section {
		padding: 16px;
	}
}
