/* Écrans (starter / exploration / combat / équipe) */
.em1-screen {
  display: none;
  margin-top: 24px;
}

.em1-screen.visible {
  display: block;
}

.em1-screen-back {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.em1-screen-back a {
  color: var(--text-muted);
}

.em1-screen-back a:hover {
  color: var(--accent);
}

.em1-screen-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Badges de type */
.em1-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.em1-type-feu { background: rgba(255, 149, 0, 0.15); color: #ff9500; }
.em1-type-eau { background: rgba(91, 140, 255, 0.15); color: #5b8cff; }
.em1-type-plante { background: rgba(74, 222, 128, 0.15); color: #4ade80; }

/* Écran : choix du starter */
.em1-starter-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  max-width: 640px;
  margin-top: 20px;
}

.em1-starter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.em1-starter-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.em1-starter-emoji {
  font-size: 3rem;
}

.em1-starter-card h4 {
  margin: 0;
}

/* Écran : exploration */
.em1-layout {
  display: grid;
  grid-template-columns: minmax(280px, 660px) 1fr;
  gap: 32px;
  align-items: start;
}

.em1-game {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.em1-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
}

.em1-hud-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.em1-hud-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.em1-hud-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.em1-party-icons {
  font-size: 1.3rem;
}

.em1-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
}

.em1-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #151a24;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  touch-action: none;
}

.em1-touch-controls {
  display: none;
  margin-top: 4px;
}

.em1-dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(2, 44px);
  gap: 4px;
}

.em1-dpad-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  touch-action: none;
}

.em1-dpad-up { grid-column: 2; grid-row: 1; }
.em1-dpad-left { grid-column: 1; grid-row: 2; }
.em1-dpad-right { grid-column: 3; grid-row: 2; }
.em1-dpad-down { grid-column: 2; grid-row: 2; }

.em1-leaderboard h3 {
  font-size: 1.1rem;
}

/* Écran : combat */
.em1-battle {
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.em1-combatant {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.em1-combatant-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.em1-combatant-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.em1-combatant-name {
  font-weight: 700;
}

.em1-combatant-emoji {
  font-size: 2.4rem;
}

.em1-hp-bar {
  height: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.em1-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #34c759);
  transition: width 0.3s ease;
}

.em1-hp-label {
  align-self: flex-end;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.em1-battle-msg {
  min-height: 1.4em;
  font-weight: 600;
  margin: 0;
}

.em1-battle-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.em1-switch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Écran : équipe & boîte */
.em1-team-list,
.em1-box-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.em1-creature-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
}

.em1-creature-emoji {
  font-size: 1.6rem;
}

.em1-creature-name {
  flex: 1;
  font-weight: 600;
}

.em1-active-badge {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 860px) {
  .em1-layout {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) and (pointer: coarse) {
  .em1-touch-controls {
    display: flex;
  }
}
