/* === Street Fight — Solo === */

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f0c29, #2c1810, #1a0808);
  color: #e0e0e0;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}
#app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 70px 16px 40px;
}

/* Sélection de perso */
.sf-character-select {
  text-align: center;
}
.sf-cs-title {
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fb923c, #dc2626, #7f1d1d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.sf-cs-subtitle {
  color: #94a3b8;
  margin-bottom: 22px;
}
.sf-cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto 24px;
}
.sf-cs-card {
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px 12px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.sf-cs-card:hover {
  transform: translateY(-4px);
  border-color: rgba(234,88,12,0.6);
  background: rgba(220,38,38,0.08);
}
.sf-cs-card.selected {
  border-color: #ea580c;
  background: rgba(234,88,12,0.18);
  box-shadow: 0 8px 24px rgba(234,88,12,0.35);
}
.sf-cs-portrait {
  width: 110px;
  height: 110px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sf-cs-portrait img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 12px rgba(220,38,38,0.4));
}
.sf-cs-name {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fef3c7;
  margin: 4px 0 2px;
}
.sf-cs-style {
  font-size: 0.78rem;
  color: #fb923c;
  margin-bottom: 6px;
}
.sf-cs-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
  min-height: 2.6em;
}
.sf-cs-diff {
  display: inline-flex;
  gap: 6px;
  margin: 6px 0 16px;
  padding: 4px;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
}
.sf-cs-diff button {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 8px 16px;
  border-radius: 7px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
}
.sf-cs-diff button.selected {
  background: linear-gradient(135deg, #dc2626, #ea580c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220,38,38,0.4);
}
.sf-cs-go {
  display: block;
  margin: 0 auto;
  padding: 16px 40px;
  background: linear-gradient(135deg, #dc2626, #ea580c);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(220,38,38,0.4);
  transition: transform 0.2s ease;
}
.sf-cs-go:hover { transform: translateY(-3px); }
.sf-cs-go:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Arène (canvas) */
.sf-arena-wrap {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  margin: 0 auto;
  max-width: 1280px;
}
.sf-arena {
  display: block;
  width: 100%;
  height: auto;
  background: #0f0c29;
}

/* Bandeau commandes sous le canvas */
.sf-cmd-info {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.78rem;
  color: #94a3b8;
}
.sf-cmd-info kbd {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(220,38,38,0.18);
  border: 1px solid rgba(220,38,38,0.35);
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #fecaca;
}

/* Overlay fin de match */
.sf-end-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
  z-index: 5;
}
.sf-end-title {
  font-size: 2.2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fef3c7;
}
.sf-end-title.win { color: #22c55e; }
.sf-end-title.lose { color: #ef4444; }
.sf-end-stats {
  color: #cbd5e1;
  font-size: 0.95rem;
}
.sf-end-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.sf-end-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(135deg, #dc2626, #ea580c);
  color: #fff;
  box-shadow: 0 4px 16px rgba(220,38,38,0.4);
}
.sf-end-actions button.secondary {
  background: rgba(255,255,255,0.1);
  box-shadow: none;
}

/* Touch controls overlay */
.sf-touch-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.sf-touch-stick {
  position: absolute;
  bottom: 80px;
  left: 30px;
  width: 130px;
  height: 130px;
  pointer-events: auto;
  touch-action: none;
}
.sf-touch-stick-base {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(234,88,12,0.4);
  border-radius: 50%;
}
.sf-touch-stick-knob {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  background: rgba(234,88,12,0.7);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.05s ease-out;
}
.sf-touch-buttons {
  position: absolute;
  bottom: 60px;
  right: 20px;
  display: grid;
  grid-template-columns: 70px 70px;
  grid-template-rows: 70px 70px;
  gap: 10px;
  pointer-events: auto;
  touch-action: none;
}
.sf-touch-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.sf-touch-btn.pressed {
  transform: scale(0.92);
  filter: brightness(1.3);
}
.sf-touch-punch  { background: rgba(220,38,38,0.7); }
.sf-touch-kick   { background: rgba(234,88,12,0.7); }
.sf-touch-block  { background: rgba(59,130,246,0.7); }
.sf-touch-special { background: rgba(168,85,247,0.7); }

/* Cacher les contrôles tactiles sur desktop */
@media (hover: hover) and (pointer: fine) {
  .sf-touch-overlay { display: none; }
}

/* Mobile : ajustements */
@media (max-width: 600px) {
  #app { padding: 60px 8px 24px; }
  .sf-cs-title { font-size: 1.5rem; }
  .sf-cs-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sf-cs-portrait { width: 90px; height: 90px; }
  .sf-cs-portrait img { width: 180px; height: 180px; }
  .sf-cs-name { font-size: 0.95rem; }
  .sf-cs-desc { font-size: 0.72rem; min-height: 3.6em; }
  .sf-end-title { font-size: 1.6rem; }
  .sf-touch-stick { width: 110px; height: 110px; bottom: 60px; left: 16px; }
  .sf-touch-buttons { grid-template-columns: 60px 60px; grid-template-rows: 60px 60px; bottom: 50px; right: 14px; }
  .sf-touch-btn { width: 60px; height: 60px; font-size: 1.2rem; }
}

/* Désactive le scroll de la page pendant le match (mobile) */
body.sf-playing { overflow: hidden; touch-action: none; }
