/**
 * Simulator Styles — Responsive v2.4
 *
 * フォントは rpm-gun-simulator.php の wp_enqueue_style で読み込み済み（二重読み込み防止）。
 * すべてのセレクターに rpmgsim- プレフィックスを付与し、テーマとの衝突を防ぐ。
 *
 * @version 2.4.0
 * @license GPL-2.0-or-later
 */

/* ===== WRAPPER ===== */

.rpmgsim-wrap {
	width: 100%;
	max-width: 100%;
	margin: 0;
	background: linear-gradient(180deg, #111318 0%, #0d0f14 100%);
	border: 1px solid #2a2d35;
	border-radius: 0;
	overflow: hidden;
	font-family: 'Rajdhani', sans-serif;
	color: #e0e4ef;
	box-sizing: border-box;
}

/* ===== TOP BAR ===== */

.rpmgsim-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	background: #0c0e12;
	border-bottom: 1px solid #1e222b;
	flex-wrap: wrap;
	gap: 8px;
}

.rpmgsim-gun-title {
	font-size: 13px;
	font-family: 'Share Tech Mono', monospace;
	color: #7a8090;
	letter-spacing: 3px;
	text-transform: uppercase;
}

.rpmgsim-preset-wrap {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

select#rpmgsim-preset {
	background: #151820;
	color: #e0e4ef;
	border: 1px solid #2a2f3d;
	padding: 5px 8px;
	font-family: 'Rajdhani', sans-serif;
	font-size: 14px;
	font-weight: 600;
	border-radius: 2px;
	cursor: pointer;
	outline: none;
	max-width: 200px;
}

/* フォーカスリング（アクセシビリティ） */
select#rpmgsim-preset:focus-visible {
	outline: 2px solid #f5c842;
	outline-offset: 2px;
}

#rpmgsim-soundBtn {
	background: #151820;
	color: #7a8090;
	border: 1px solid #2a2f3d;
	padding: 5px 10px;
	font-family: 'Share Tech Mono', monospace;
	font-size: 11px;
	border-radius: 2px;
	cursor: pointer;
	white-space: nowrap;
}

#rpmgsim-soundBtn.on {
	color: #4ade80;
	border-color: #4ade80;
}

#rpmgsim-soundBtn:focus-visible {
	outline: 2px solid #f5c842;
	outline-offset: 2px;
}

/* ===== CANVAS AREA ===== */

.rpmgsim-canvas-area {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	cursor: crosshair;
	overflow: hidden;
	touch-action: none;
	border-bottom: 2px solid #1a1e28;
}

#rpmgsim-mainCanvas {
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
}

#rpmgsim-sight {
	position: absolute;
	top: 0;
	left: 0;
	transform: translate(-50%, -50%);
	pointer-events: none;
	width: 44px;
	height: 44px;
	will-change: transform;
}

#rpmgsim-flashOverlay {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 50% 100%, rgba(255, 160, 50, 0.35) 0%, transparent 70%);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.04s;
}

/* ===== KILL FEED ===== */

#rpmgsim-killFeed {
	position: absolute;
	top: 10px;
	right: 12px;
	text-align: right;
	pointer-events: none;
}

.rpmgsim-kill-entry {
	font-family: 'Share Tech Mono', monospace;
	font-size: 13px;
	color: #f5c842;
	animation: rpmgsim-killFadeOut 2s forwards;
}

@keyframes rpmgsim-killFadeOut {
	0%   { opacity: 1; transform: translateY(0); }
	100% { opacity: 0; transform: translateY(-10px); }
}

/* ===== HIT NUMBERS ===== */

.rpmgsim-hit-num {
	position: absolute;
	font-family: 'Share Tech Mono', monospace;
	font-size: 18px;
	font-weight: bold;
	color: #ff6060;
	text-shadow: 0 0 8px rgba(255, 60, 60, 0.8);
	pointer-events: none;
	animation: rpmgsim-hitAnim 0.8s forwards;
}

@keyframes rpmgsim-hitAnim {
	0%   { opacity: 1; transform: translateY(0)    scale(1.3); }
	100% { opacity: 0; transform: translateY(-30px) scale(0.8); }
}

/* ===== HUD ===== */

.rpmgsim-hud {
	padding: 14px 16px 16px;
}

.rpmgsim-hud-row1 {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 14px;
}

.rpmgsim-rpm-block {
	flex: 1;
}

.rpmgsim-rpm-label {
	display: flex;
	justify-content: space-between;
	margin-bottom: 5px;
}

.rpmgsim-rpm-label span {
	font-size: 12px;
	font-family: 'Share Tech Mono', monospace;
	color: #7a8090;
	letter-spacing: 1px;
}

#rpmgsim-rpmVal {
	font-family: 'Share Tech Mono', monospace;
	font-size: 26px;
	color: #f5c842;
	font-weight: bold;
}

/* RPM スライダー */
input[type="range"]#rpmgsim-rpmSlider {
	-webkit-appearance: none;
	width: 100%;
	height: 4px;
	background: #1e222b;
	border-radius: 2px;
	outline: none;
}

input[type="range"]#rpmgsim-rpmSlider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	background: #f5c842;
	border-radius: 50%;
	cursor: pointer;
}

input[type="range"]#rpmgsim-rpmSlider::-moz-range-thumb {
	width: 16px;
	height: 16px;
	background: #f5c842;
	border-radius: 50%;
	cursor: pointer;
	border: none;
}

input[type="range"]#rpmgsim-rpmSlider:focus-visible {
	outline: 2px solid #f5c842;
	outline-offset: 4px;
	border-radius: 2px;
}

/* ===== STATS GRID ===== */

.rpmgsim-hud-stats {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
	margin-bottom: 14px;
}

.rpmgsim-stat-box {
	background: #0c0e12;
	border: 1px solid #1e222b;
	border-radius: 2px;
	padding: 10px 12px;
	text-align: center;
}

.rpmgsim-stat-label {
	font-size: 11px;
	font-family: 'Share Tech Mono', monospace;
	color: #6a7080;
	letter-spacing: 2px;
	margin-bottom: 4px;
}

.rpmgsim-stat-val {
	font-family: 'Share Tech Mono', monospace;
	font-size: 24px;
	color: #e0e4ef;
	font-weight: bold;
	line-height: 1;
}

#rpmgsim-ammoVal {
	color: #f5c842;
	font-size: 16px;
}

/* ===== TEMPERATURE BAR ===== */

.rpmgsim-temp-bar-bg {
	background: #0c0e12;
	border: 1px solid #1e222b;
	border-radius: 2px;
	padding: 10px 14px;
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

.rpmgsim-temp-label-left {
	font-size: 11px;
	font-family: 'Share Tech Mono', monospace;
	color: #6a7080;
	letter-spacing: 2px;
	white-space: nowrap;
}

.rpmgsim-temp-track {
	flex: 1;
	height: 8px;
	background: #1e222b;
	border-radius: 4px;
	overflow: hidden;
}

#rpmgsim-tempFill {
	height: 100%;
	width: 0%;
	border-radius: 4px;
	transition: width 0.08s, background 0.2s;
}

/* ===== RELOAD BUTTON ===== */

#rpmgsim-reloadBtn {
	display: block;
	margin: 0 auto;
	width: 130px;
	height: 48px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	touch-action: manipulation;
}

#rpmgsim-reloadBtn img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

#rpmgsim-reloadBtn:hover {
	opacity: 0.8;
}

#rpmgsim-reloadBtn:focus-visible {
	outline: 2px solid #f5c842;
	outline-offset: 2px;
}

#rpmgsim-reloadProgress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 2px;
	background: #f5c842;
	width: 0%;
}

/* ===== OVERHEAT WARNING ===== */

#rpmgsim-overheatWarn {
	display: none;
	position: absolute;
	inset: 0;
	background: rgba(255, 50, 50, 0.08);
	border: 2px solid rgba(255, 80, 80, 0.4);
	pointer-events: none;
	animation: rpmgsim-overheatPulse 0.3s infinite alternate;
}

@keyframes rpmgsim-overheatPulse {
	from { background: rgba(255, 50, 50, 0.05); }
	to   { background: rgba(255, 50, 50, 0.15); }
}

/* ===== HINT ===== */

.rpmgsim-hint {
	font-family: 'Share Tech Mono', monospace;
	font-size: 11px;
	color: #4a5060;
	text-align: center;
	padding: 4px 0 0;
	letter-spacing: 2px;
}

/* ===== CANVAS TOP HUD ===== */

#rpmgsim-canvas-hud {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding: 6px 12px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 100%);
	pointer-events: none;
	z-index: 10;
	gap: 4px;
}

.rpmgsim-chud-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	min-width: 56px;
}

.rpmgsim-chud-label {
	font-family: 'Share Tech Mono', monospace;
	font-size: 9px;
	color: #6a7080;
	letter-spacing: 2px;
	line-height: 1;
}

.rpmgsim-chud-val {
	font-family: 'Share Tech Mono', monospace;
	font-size: 18px;
	color: #e0e4ef;
	font-weight: bold;
	line-height: 1;
}

/* 弾薬（1番目） */
.rpmgsim-chud-item:nth-child(1) .rpmgsim-chud-val {
	color: #f5c842;
	font-size: 14px;
}

/* スコア */
.rpmgsim-chud-score .rpmgsim-chud-val {
	color: #4ade80;
	font-size: 20px;
}

/* ===== HIT RADIUS SLIDER THUMB ===== */

input[type="range"]#rpmgsim-hit-radius::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	background: #4dd9ff;
	border-radius: 50%;
	cursor: pointer;
}

input[type="range"]#rpmgsim-hit-radius::-moz-range-thumb {
	width: 16px;
	height: 16px;
	background: #4dd9ff;
	border-radius: 50%;
	cursor: pointer;
	border: none;
}

input[type="range"]#rpmgsim-hit-radius:focus-visible {
	outline: 2px solid #4dd9ff;
	outline-offset: 4px;
	border-radius: 2px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 680px) {
	.rpmgsim-wrap { border-left: none; border-right: none; }
	.rpmgsim-gun-title { font-size: 11px; letter-spacing: 2px; }
	select#rpmgsim-preset { max-width: 160px; font-size: 13px; }
}

@media (max-width: 480px) {
	.rpmgsim-canvas-area { aspect-ratio: 4 / 3; }
	.rpmgsim-gun-title { display: none; }
	.rpmgsim-topbar { padding: 8px 12px; }
	.rpmgsim-hud { padding: 10px 12px 12px; }
	.rpmgsim-stat-val { font-size: 20px; }
	#rpmgsim-ammoVal { font-size: 14px; }
	.rpmgsim-hud-stats { gap: 6px; }
	.rpmgsim-stat-box { padding: 7px 8px; }
	.rpmgsim-stat-label { font-size: 10px; letter-spacing: 1px; }
	#rpmgsim-rpmVal { font-size: 22px; }
	.rpmgsim-hint { font-size: 10px; letter-spacing: 1px; }
	select#rpmgsim-preset { max-width: 150px; font-size: 12px; padding: 4px 6px; }
	#rpmgsim-soundBtn { font-size: 10px; padding: 4px 8px; }
	.rpmgsim-chud-val { font-size: 14px; }
	.rpmgsim-chud-item:nth-child(1) .rpmgsim-chud-val { font-size: 12px; }
	.rpmgsim-chud-score .rpmgsim-chud-val { font-size: 16px; }
	.rpmgsim-chud-label { font-size: 8px; }
}

@media (max-width: 360px) {
	.rpmgsim-stat-box { padding: 5px 4px; }
	#rpmgsim-sight { width: 36px; height: 36px; }
}
