/* Games Slot - APEX ルーレット */

.gs-roulette {
	--gs-bg: #14161c;
	--gs-panel: #1f232e;
	--gs-edge: #2c3140;
	--gs-accent: #ff4655; /* APEX レッド */
	--gs-text: #f2f4f8;
	--gs-muted: #9aa3b2;

	max-width: 760px;
	margin: 1.5em auto;
	padding: 24px;
	background: var(--gs-bg);
	border: 1px solid var(--gs-edge);
	border-radius: 14px;
	color: var(--gs-text);
	font-family: -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
	box-sizing: border-box;
}

.gs-roulette *,
.gs-roulette *::before,
.gs-roulette *::after {
	box-sizing: border-box;
}

/* 見出しは div で出力（テーマCSSや目次プラグインに拾われないように）。
   セレクタを .gs-roulette で囲って詳細度を上げ、テーマに引っ張られないようにする。 */
.gs-roulette .gs-title {
	margin: 0 0 18px;
	padding: 0;
	font-family: inherit;
	font-size: 1.4em;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-align: center;
	color: var(--gs-text);
}

.gs-roulette .gs-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin: 8px auto 0;
	background: var(--gs-accent);
	border-radius: 2px;
}

/* オプション */
.gs-options {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	color: var(--gs-muted);
	font-size: 0.95em;
}

.gs-options label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.gs-options select {
	background: var(--gs-panel);
	color: var(--gs-text);
	border: 1px solid var(--gs-edge);
	border-radius: 6px;
	padding: 4px 8px;
}

/* セクション（レジェンド／武器／アイテム） */
.gs-section {
	margin-top: 20px;
}

.gs-roulette .gs-section-title {
	margin: 0 0 10px;
	padding: 0 0 0 10px;
	border-left: 4px solid var(--gs-accent);
	font-family: inherit;
	font-size: 1.02em;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: var(--gs-text);
	line-height: 1.3;
}

/* リール並び */
.gs-reels {
	display: grid;
	gap: 14px;
}

/* レジェンドは1枚を中央に、大きすぎないよう幅を制限 */
.gs-reels-legend {
	grid-template-columns: minmax(0, 240px);
	justify-content: center;
}

/* 武器は2列。1丁だけ表示のとき（Valorantのメイン/サブのみ）は中央寄せ。 */
.gs-reels-weapons {
	grid-template-columns: repeat(2, 1fr);
}

.gs-reels-weapons.gs-one {
	grid-template-columns: minmax(0, 240px);
	justify-content: center;
}

/* アイテムのスロットは小さめ。数が増えても折り返して並ぶ。 */
.gs-item-reels {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
	gap: 8px;
	margin-top: 14px;
}

.gs-item-reels:empty {
	margin-top: 0;
}

.gs-reel {
	background: var(--gs-panel);
	border: 1px solid var(--gs-edge);
	border-radius: 10px;
	padding: 12px 8px;
	text-align: center;
	overflow: hidden;
	position: relative;
}

.gs-reel-label {
	font-size: 0.78em;
	letter-spacing: 0.05em;
	color: var(--gs-muted);
	margin-bottom: 8px;
	text-transform: uppercase;
}

.gs-cell {
	min-height: 110px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.gs-img {
	width: 72px;
	height: 72px;
	object-fit: contain;
}

/* 画像なし（アーマー無し等）のプレースホルダ。画像と同じ枠で配置を安定させる。 */
.gs-img-blank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--gs-muted);
	font-size: 1.8em;
	line-height: 1;
}

.gs-name {
	font-weight: 700;
	font-size: 0.98em;
	line-height: 1.2;
	word-break: break-word;
}

/* 画像が無いときは名前を大きめに見せる */
.gs-img-missing .gs-name {
	font-size: 1.1em;
}

.gs-qty {
	font-size: 0.85em;
	color: var(--gs-accent);
	font-weight: 800;
}

/* アイテムのスロットだけ小さく表示 */
.gs-reel-item {
	padding: 8px 4px;
}

.gs-reel-item .gs-reel-label {
	font-size: 0.64em;
	margin-bottom: 4px;
}

.gs-reel-item .gs-cell {
	min-height: 62px;
	gap: 3px;
}

.gs-reel-item .gs-img {
	width: 40px;
	height: 40px;
}

.gs-reel-item .gs-name {
	font-size: 0.72em;
}

.gs-reel-item .gs-qty {
	font-size: 0.72em;
}

/* バッグのスロット数（SPINボタンの直上に配置） */
.gs-slots-bar {
	margin-top: 18px;
	text-align: center;
}

.gs-slots-bar .gs-opt-slots {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap; /* ラベルが縦組みにならないように */
	color: var(--gs-muted);
	font-size: 0.95em;
}

.gs-slots-bar .gs-slots-text {
	white-space: nowrap;
}

.gs-slots-bar select {
	background: var(--gs-panel);
	color: var(--gs-text);
	border: 1px solid var(--gs-edge);
	border-radius: 6px;
	padding: 4px 8px;
}

/* Valorant: クレジット入力バー（SPINの上） */
.gs-credit-bar {
	margin-top: 18px;
	text-align: center;
}

.gs-credit-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	color: var(--gs-muted);
	font-size: 0.95em;
}

.gs-credit-bar input.gs-credit {
	width: 120px;
	background: var(--gs-panel);
	color: var(--gs-text);
	border: 1px solid var(--gs-edge);
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 1em;
	text-align: right;
}

.gs-credit-note {
	margin: 8px 0 0;
	font-size: 0.8em;
	color: var(--gs-muted);
	line-height: 1.5;
}

/* Valorant: アーマーは1枚を中央に小さめ表示 */
.gs-reels-armor {
	grid-template-columns: minmax( 0, 200px );
}

/* Valorant: 再抽選ボタンを均等グリッドで整列（数が増えても綺麗に折り返す） */
.gs-respin-row {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 130px, 1fr ) );
	gap: 10px;
	margin-top: 10px;
}

.gs-respin {
	padding: 11px 10px;
	font-size: 0.85em;
	font-weight: 800;
	letter-spacing: 0.01em;
	line-height: 1.3;
	text-align: center;
	color: var(--gs-text);
	background: var(--gs-panel);
	border: 1px solid var(--gs-accent);
	border-radius: 10px;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

.gs-respin:hover {
	filter: brightness( 1.15 );
}

.gs-respin:active {
	transform: translateY( 1px );
}

.gs-respin:disabled {
	opacity: 0.4;
	cursor: default;
	border-color: var(--gs-edge);
}

/* 予算内に武器が無いときの表示 */
.gs-none {
	color: var(--gs-muted);
	font-weight: 700;
}

/* 武器・アーマーの価格（クレジット）。空でも同じ高さを確保して揺れを防ぐ。 */
.gs-cost {
	display: block;
	min-height: 1.1em;
	line-height: 1.1;
	font-size: 0.82em;
	font-weight: 800;
	color: var(--gs-accent);
}

/* スピン演出：回転中は素早くブレてパパパ感を出す */
.gs-reel.gs-spinning .gs-cell {
	animation: gs-blur 0.07s steps(2) infinite;
}

@keyframes gs-blur {
	0% { transform: translateY(-3px); opacity: 0.55; }
	50% { transform: translateY(3px); opacity: 1; }
	100% { transform: translateY(-3px); opacity: 0.55; }
}

/* 停止時：縮みから弾けて赤く一瞬光る「パン！」 */
.gs-reel.gs-stopped {
	animation: gs-pop 0.32s cubic-bezier( 0.2, 1.5, 0.4, 1 );
	border-color: var(--gs-accent);
}

@keyframes gs-pop {
	0% { transform: scale( 0.9 ); box-shadow: 0 0 20px 3px rgba( 255, 70, 85, 0.55 ); }
	60% { transform: scale( 1.07 ); box-shadow: 0 0 12px 1px rgba( 255, 70, 85, 0.35 ); }
	100% { transform: scale( 1 ); box-shadow: 0 0 0 0 rgba( 255, 70, 85, 0 ); }
}

/* SPIN ボタン */
.gs-spin {
	display: block;
	width: 100%;
	margin: 22px 0 0;
	padding: 14px;
	font-size: 1.15em;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: #fff;
	background: var(--gs-accent);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.05s ease;
}

.gs-spin:hover {
	filter: brightness(1.1);
}

.gs-spin:active {
	transform: translateY(1px);
}

.gs-spin:disabled {
	opacity: 0.6;
	cursor: default;
}

/* スマホ */
@media ( max-width: 540px ) {
	.gs-roulette {
		padding: 16px;
	}
	.gs-reels,
	.gs-item-reels {
		grid-template-columns: repeat(3, 1fr);
		gap: 8px;
	}
	.gs-img {
		width: 52px;
		height: 52px;
	}
	.gs-name {
		font-size: 0.82em;
	}
}
