* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}
html, body {
  background: #03050a;
  color: #fff;
  font-family: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #02040a;
  overflow: hidden;
}
canvas#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Screen Flash Overlay */
.screen-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 35;
  transition: opacity 0.08s ease-out;
}

/* Spell Card Declaration Cut-in */
.spell-cutin {
  position: absolute;
  left: 0;
  right: 0;
  top: 22%;
  pointer-events: none;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  animation: cutinSlide 1.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.cutin-bg-rays {
  position: absolute;
  inset: -40px 0;
  background: repeating-linear-gradient(
    -25deg,
    rgba(56, 189, 248, 0.14) 0px,
    rgba(56, 189, 248, 0.14) 12px,
    transparent 12px,
    transparent 28px
  );
  animation: rayScroll 0.8s linear infinite;
  pointer-events: none;
}
.spell-cutin.cpu-cutin .cutin-bg-rays {
  background: repeating-linear-gradient(
    -25deg,
    rgba(244, 63, 94, 0.16) 0px,
    rgba(244, 63, 94, 0.16) 12px,
    transparent 12px,
    transparent 28px
  );
}
@keyframes rayScroll {
  from { background-position: 0 0; }
  to { background-position: 80px 0; }
}
.cutin-stripe {
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #38bdf8 25%, #ffffff 50%, #38bdf8 75%, transparent 100%);
  box-shadow: 0 0 20px #38bdf8, 0 0 40px #38bdf8;
}
.spell-cutin.cpu-cutin .cutin-stripe {
  background: linear-gradient(90deg, transparent 0%, #f43f5e 25%, #ffffff 50%, #f43f5e 75%, transparent 100%);
  box-shadow: 0 0 20px #f43f5e, 0 0 40px #f43f5e;
}
.cutin-body {
  width: 100%;
  padding: 16px 0;
  background: linear-gradient(90deg, rgba(15,23,42,0) 0%, rgba(10,16,32,0.92) 20%, rgba(24,36,64,0.96) 50%, rgba(10,16,32,0.92) 80%, rgba(15,23,42,0) 100%);
  text-align: center;
  position: relative;
}
.cutin-emblem {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #fef08a;
  text-shadow: 0 0 12px #f59e0b;
  margin-bottom: 3px;
}
.cutin-caster {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #7dd3fc;
  margin-bottom: 4px;
}
.spell-cutin.cpu-cutin .cutin-caster {
  color: #fda4af;
}
.cutin-title {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 7px;
  color: #ffffff;
  text-shadow: 0 0 22px #38bdf8, 0 0 48px #38bdf8;
}
.spell-cutin.cpu-cutin .cutin-title {
  text-shadow: 0 0 22px #f43f5e, 0 0 48px #f43f5e;
}
@keyframes cutinSlide {
  0% { opacity: 0; transform: translateX(-110px) scale(0.92); }
  14% { opacity: 1; transform: translateX(0) scale(1.04); }
  82% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(110px) scale(0.96); }
}

/* HUD Overlays */
.hud-panel {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 15;
}
.hud-center-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.hud-center-btns {
  display: flex;
  gap: 6px;
}
.match-timer {
  background: rgba(10, 15, 28, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.45);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #f8fafc;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
  backdrop-filter: blur(6px);
}
.hud-mini-btn {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.15s;
}
.hud-mini-btn:hover {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}
.hud-mini-btn:active {
  transform: scale(0.95);
}

.player-hud {
  width: 345px;
  background: linear-gradient(135deg, rgba(12, 18, 32, 0.84) 0%, rgba(20, 28, 48, 0.78) 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 12px 16px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.6), inset 0 0 18px rgba(56, 189, 248, 0.06);
}
.p2-hud-box {
  border-color: rgba(244, 63, 94, 0.28);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.6), inset 0 0 18px rgba(244, 63, 94, 0.06);
}
.hud-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wins-badge {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.wins-badge.cpu-wins {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}
.bar-bg {
  position: relative;
  width: 100%;
  height: 16px;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.6px;
}
.hp-fill-p1 {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 55%, #818cf8 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
  transition: width 0.06s ease-out;
}
.hp-fill-p2 {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #be123c 0%, #f43f5e 55%, #fb7185 100%);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.5);
  transition: width 0.06s ease-out;
}
.blade-bg {
  width: 100%;
  height: 8px;
  background: #0f172a;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.blade-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #a855f7 100%);
  transition: width 0.05s linear;
}
.blade-fill.empty {
  background: #ef4444;
}
.ult-bg {
  position: relative;
  width: 100%;
  height: 13px;
  background: #090d16;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ult-text {
  font-size: 9px;
}
.ult-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%);
  transition: width 0.1s linear;
}
.ult-fill.ready {
  background: linear-gradient(90deg, #f59e0b 0%, #fef08a 50%, #ffffff 100%);
  box-shadow: 0 0 16px #fbbf24;
  animation: pulse 0.55s infinite alternate;
}
@keyframes pulse {
  from { opacity: 0.8; }
  to { opacity: 1.0; }
}
.dash-dots {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  align-items: center;
}
.dash-dot {
  width: 20px;
  height: 8px;
  border-radius: 4px;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  transition: opacity 0.15s;
}
.dash-dot.cpu-dot {
  background: #fb7185;
  box-shadow: 0 0 10px #fb7185;
}
.dash-dot.empty {
  background: #334155;
  box-shadow: none;
  opacity: 0.45;
}

.hud-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 4px;
}
.skill-status {
  font-size: 11px;
  color: #38bdf8;
  margin-top: 2px;
  font-weight: 800;
}
.graze-box {
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 8px;
  padding: 4px 10px;
  text-align: center;
  min-width: 66px;
}
.graze-box.cpu-graze {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.4);
}
.graze-label {
  font-size: 9px;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 1px;
}
.cpu-graze .graze-label {
  color: #fda4af;
}
.graze-value {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
}

/* Training Quick Panel */
.training-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(12, 18, 32, 0.88);
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 25;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.training-title {
  font-size: 11px;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.training-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.t-btn {
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.15s;
}
.t-btn:hover {
  background: #34d399;
  color: #0f172a;
}
.t-btn:active {
  transform: scale(0.95);
}

/* Overlay Screens */
.overlay-screen {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(12, 18, 36, 0.72) 0%, rgba(4, 6, 14, 0.88) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  pointer-events: auto;
  padding: 20px;
  overflow-y: auto;
}
.hidden {
  display: none !important;
}
.start-content-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 860px;
  width: 100%;
  z-index: 102;
}
.title-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 10px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}
h1.main-title, h1 {
  font-size: 52px;
  font-weight: 900;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #f472b6 0%, #38bdf8 45%, #fde047 80%, #a855f7 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 4px;
  filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.35));
  animation: titleShimmer 4s linear infinite;
}
@keyframes titleShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
p.subtitle {
  color: #cbd5e1;
  margin-bottom: 18px;
  font-size: 15px;
  letter-spacing: 1px;
}
.controls-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(99, 102, 241, 0.32);
  border-radius: 14px;
  padding: 16px 24px;
  margin-bottom: 20px;
  max-width: 640px;
  width: 94%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  font-size: 13px;
  color: #e2e8f0;
}
.controls-grid strong {
  color: #7dd3fc;
}
.mode-prompt {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 1px;
}
.btn-group {
  display: flex;
  gap: 12px;
  flex-direction: column;
  align-items: center;
}
.mode-btn-row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 840px;
}
.btn {
  padding: 13px 22px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  background: #38bdf8;
  color: #0f172a;
  min-width: 145px;
  text-align: center;
  letter-spacing: 1px;
  position: relative;
  z-index: 105;
}
.btn:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.08);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.55);
}
.btn:active {
  transform: translateY(0) scale(0.97);
}
.btn-training {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}
.btn-easy {
  background: linear-gradient(135deg, #059669 0%, #34d399 100%);
  color: #06281e;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.4);
}
.btn-normal {
  background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
  color: #1e1302;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.4);
}
.btn-hard {
  background: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.45);
}
.btn-lunatic {
  background: linear-gradient(135deg, #9333ea 0%, #ec4899 50%, #f43f5e 100%);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}
.btn-lunatic:hover {
  box-shadow: 0 6px 28px rgba(236, 72, 153, 0.85);
}

#round-winner {
  font-size: 46px;
  font-weight: 900;
  margin-bottom: 10px;
  letter-spacing: 3px;
  color: #f1f5f9;
  text-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
}
.rank-badge {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 7px 24px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #fef08a 100%);
  color: #0f172a;
  margin-bottom: 18px;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.6);
}
.stats-card {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 22px;
  width: 330px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #94a3b8;
}
.stat-row strong {
  color: #f8fafc;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 28px;
  line-height: 1;
  font-weight: bold;
  color: #cbd5e1;
  cursor: pointer;
  pointer-events: auto;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.close-btn:hover {
  color: #fff;
  background: #f43f5e;
  border-color: #f43f5e;
  transform: rotate(90deg);
}

/* Top Right Menu Button */
.top-right-nav {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 115;
  pointer-events: auto;
}
.loadout-nav-btn {
  padding: 11px 22px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid #38bdf8;
  border-radius: 10px;
  color: #7dd3fc;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.28);
  transition: all 0.18s;
}
.loadout-nav-btn:hover {
  background: #38bdf8;
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.65);
}
.loadout-nav-btn:active {
  transform: scale(0.96);
}

/* Split Loadout Screen UI */
.loadout-split-container {
  width: 95%;
  max-width: 1320px;
  display: flex;
  gap: 20px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
  z-index: 105;
}
.loadout-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(15, 23, 42, 0.78);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.column-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}
.p1-title {
  color: #38bdf8;
  border-color: #38bdf8;
}
.cpu-title {
  color: #fb7185;
  border-color: #fb7185;
}

.category-section {
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 12px;
}
.category-section.border-cpu {
  border-color: rgba(244, 63, 94, 0.32);
}

.category-header {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #38bdf8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-header.header-cpu {
  color: #fb7185;
}

.skill-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 10px;
}
.skill-card {
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.18s;
}
.skill-card:hover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
}

.p1-column .skill-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.cpu-column .skill-card.active {
  border-color: #fb7185;
  background: rgba(244, 63, 94, 0.22);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
}

.skill-card-name {
  font-size: 13px;
  font-weight: bold;
  color: #f8fafc;
  margin-bottom: 4px;
}
.skill-card-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

/* =========================================
   SMARTPHONE / MOBILE RESPONSIVE & CONTROLS
   ========================================= */
body.is-mobile,
body.is-mobile #game-container {
  touch-action: none;
  overscroll-behavior: none;
}

/* コンパクトなHPゲージ＆HUD（スマホ版） */
body.is-mobile .hud-panel {
  top: 6px;
  left: 8px;
  right: 8px;
}

body.is-mobile .player-hud {
  width: 175px;
  padding: 5px 8px;
  border-radius: 8px;
}

body.is-mobile .hud-title {
  font-size: 9px;
  margin-bottom: 3px;
  letter-spacing: 0.3px;
}

body.is-mobile .wins-badge {
  font-size: 8px;
  padding: 0px 5px;
}

body.is-mobile .bar-bg {
  height: 10px;
  margin-bottom: 3px;
  border-radius: 5px;
}

body.is-mobile .bar-text {
  font-size: 8px;
}

body.is-mobile .blade-bg {
  height: 5px;
  margin-bottom: 3px;
}

body.is-mobile .ult-bg {
  height: 8px;
  margin-bottom: 3px;
  border-radius: 4px;
}

body.is-mobile .ult-text {
  font-size: 7px;
}

body.is-mobile .dash-row {
  font-size: 8px !important;
}

body.is-mobile .dash-dot {
  width: 12px;
  height: 5px;
}

body.is-mobile .hud-sub-row {
  margin-top: 2px;
}

body.is-mobile .skill-status {
  font-size: 8px;
  margin-top: 1px;
  line-height: 1.15;
}

body.is-mobile .graze-box {
  padding: 2px 5px;
  min-width: 40px;
  border-radius: 5px;
}

body.is-mobile .graze-label {
  font-size: 7px;
}

body.is-mobile .graze-value {
  font-size: 10px;
}

body.is-mobile .match-timer {
  padding: 2px 10px;
  font-size: 11px;
}

body.is-mobile .hud-mini-btn {
  font-size: 9px;
  padding: 3px 7px;
}

/* スマホ版タイトル・オーバーレイ最適化 */
body.is-mobile .overlay-screen {
  padding: 10px;
  justify-content: flex-start;
  padding-top: 18px;
}

body.is-mobile .top-right-nav {
  top: 8px;
  right: 10px;
}

body.is-mobile .loadout-nav-btn {
  padding: 6px 12px;
  font-size: 11px;
}

body.is-mobile .title-badge {
  font-size: 9px;
  padding: 3px 10px;
  margin-bottom: 4px;
}

body.is-mobile h1.main-title,
body.is-mobile h1 {
  font-size: 28px;
  letter-spacing: 2px;
  margin-bottom: 2px;
}

body.is-mobile p.subtitle {
  font-size: 11px;
  margin-bottom: 8px;
}

body.is-mobile .controls-card {
  padding: 8px 12px;
  margin-bottom: 10px;
}

body.is-mobile .controls-grid {
  gap: 4px 10px;
  font-size: 10px;
}

body.is-mobile .mode-prompt {
  font-size: 11px;
  margin-bottom: 6px;
}

body.is-mobile .mode-btn-row {
  gap: 6px;
}

body.is-mobile .btn {
  padding: 8px 12px;
  font-size: 11px;
  min-width: 96px;
  border-radius: 8px;
}

body.is-mobile .loadout-split-container {
  flex-direction: column;
  max-height: 62vh;
  gap: 10px;
}

body.is-mobile .training-panel {
  top: 78px;
  bottom: auto;
  left: 8px;
  padding: 5px 8px;
}

body.is-mobile .training-title {
  font-size: 9px;
  margin-bottom: 4px;
}

body.is-mobile .t-btn {
  font-size: 9px;
  padding: 3px 6px;
}

/* バーチャルコントロール（スマホ版） */
.mobile-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.mobile-stick-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44vw;
  height: 58vh;
  pointer-events: auto;
  touch-action: none;
}

.mobile-stick-base {
  position: absolute;
  left: 28px;
  bottom: 26px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.42);
  border: 2px solid rgba(56, 189, 248, 0.48);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-stick-knob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.9) 0%, rgba(2, 132, 199, 0.78) 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  transform: translate(0px, 0px);
}

.mobile-action-cluster {
  position: absolute;
  right: 16px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.mobile-skill-arc,
.mobile-main-arc {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.m-btn {
  pointer-events: auto;
  touch-action: none;
  border-radius: 50%;
  font-weight: 900;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.06s, background 0.1s;
}

.m-btn:active,
.m-btn.active {
  transform: scale(0.91);
  filter: brightness(1.3);
}

.m-btn-sm {
  width: 46px;
  height: 46px;
  font-size: 11px;
}

.m-btn-md {
  width: 56px;
  height: 56px;
  font-size: 12px;
}

.m-btn-lg {
  width: 68px;
  height: 68px;
  font-size: 14px;
}

.m-btn-atk {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.58);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

.m-btn-charge {
  border-color: #fbbf24;
  background: rgba(217, 119, 6, 0.55);
}

.m-btn-dash {
  border-color: #34d399;
  background: rgba(5, 150, 105, 0.55);
}

.m-btn-q {
  border-color: #c084fc;
  background: rgba(126, 34, 206, 0.55);
}

.m-btn-e {
  border-color: #fbbf24;
  background: rgba(180, 83, 9, 0.55);
}

.m-btn-r {
  border-color: #f43f5e;
  background: rgba(190, 18, 60, 0.62);
}

.m-btn-slow {
  border-color: #94a3b8;
  font-size: 10px;
}

.m-btn-slow.active {
  border-color: #fde047;
  background: rgba(234, 179, 8, 0.65);
  color: #0f172a;
}

.m-btn.ready-glow {
  box-shadow: 0 0 18px #fbbf24, inset 0 0 10px #fef08a;
  border-color: #fef08a;
}

/* スマホ版限定：横画面＆全画面ボタン */
.mobile-fullscreen-btn {
  display: none;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.28));
  border-color: #34d399;
  color: #a7f3d0;
}

body.is-mobile .mobile-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.is-mobile .top-right-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.is-mobile .mobile-fullscreen-btn.is-active {
  background: linear-gradient(135deg, #059669, #0284c7);
  border-color: #fde047;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.6);
}