/* Simulator Styles - Responsive v2.2 */
/* フォントは rpm-gun-simulator.php の wp_enqueue_style で読み込み済み（二重読み込み防止） */

.rpmgsim-wrap {
  width: 100%;
  max-width: 100%;    /* 親要素幅いっぱいに拡張 */
  margin: 0;          /* 外側余白をゼロに */
  background: linear-gradient(180deg, #111318 0%, #0d0f14 100%);
  border: 1px solid #2a2d35;
  border-radius: 0;   /* 幅いっぱい表示に合わせ角丸を除去 */
  box-shadow: none;   /* 外側の影を除去 */
  overflow: hidden;
  font-family: 'Rajdhani', sans-serif;
  color: #e0e4ef;
  box-sizing: border-box;
}

.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;
}

#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-canvas-area {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;   /* PCでも縦横比を維持しながら幅100% */
  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;
}

#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)} }

.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)} }

.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;
}

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; }

.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; }

.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; }

#rpmgsim-reloadBtn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, #1e222b 0%, #161920 100%);
  border: 1px solid #2a2f3d;
  border-bottom: 2px solid #f5c842;
  color: #f5c842;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

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

#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)} }

.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;
}

.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; }

@media (max-width: 480px) {
  .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; }
}

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

@media (max-width: 680px) {
  .rpmgsim-wrap { margin: 0; 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; }
}

@media (max-width: 360px) {
  /* aspect-ratioで自動調整されるので固定heightは不要 */
  .rpmgsim-stat-box { padding: 5px 4px; }
  #rpmgsim-sight { width: 36px; height: 36px; }
}

/* HIT RADIUS スライダーのつまみ */
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;
}
