/* Interface du jeu : accueil, sélection, HUD mobile, file d'attente, fin de partie. */

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.screen > * {
  pointer-events: auto;
}

.screen.hidden {
  display: none !important;
}

/* ------------------------------------------------------------------ accueil */
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 10px;
}

.home-top .brand {
  font-size: 14px;
}

.home-top .brand small {
  font-size: 9px;
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  pointer-events: none;
}

.home-title {
  margin: 0;
  font-size: clamp(30px, 9vw, 54px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.6);
}

.home-title span {
  color: var(--gold);
}

.home-tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(12px, 3vw, 15px);
  letter-spacing: 0.04em;
  max-width: 460px;
}

.home-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.home-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(9, 6, 4, 0.88) 40%);
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 12px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(42, 29, 22, 0.92), rgba(22, 16, 12, 0.94));
  color: var(--cream);
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: var(--accent, var(--gold));
}

.hero-card.selected {
  border-color: var(--accent, var(--gold));
  transform: translateY(-3px);
}

.hero-card .role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent, var(--gold));
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-card .name {
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-card .tag {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  min-height: 30px;
}

.hero-card .stats {
  display: none;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
}

.hero-card .special {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, var(--gold));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 760px) {
  .hero-card .tag,
  .hero-card .stats {
    display: block;
  }
  .hero-card .stats {
    display: flex;
  }
}

.play-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.play-row .solid-btn {
  min-width: 220px;
}

.play-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------------ file */
.queue-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: rgba(8, 6, 4, 0.84);
  backdrop-filter: blur(14px);
}

.queue-card {
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(42, 29, 21, 0.96), rgba(20, 14, 11, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.queue-card h2 {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.queue-card .place {
  font-size: clamp(52px, 15vw, 74px);
  font-weight: 900;
  line-height: 1;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.queue-card .eta {
  color: var(--muted);
  font-size: 13px;
}

.queue-card .vip {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(245, 185, 66, 0.4);
  font-size: 12px;
  line-height: 1.5;
}

.queue-card .vip b {
  color: var(--gold);
}

.queue-card .code-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.queue-card input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ------------------------------------------------------------------- HUD */
#screen-game {
  pointer-events: none;
}

#screen-game > * {
  pointer-events: auto;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hud > * {
  position: absolute;
  pointer-events: auto;
}

.hud-top-left {
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  width: min(46vw, 200px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plateau-card {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(16, 11, 9, 0.78);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.plateau-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 5px;
}

.plateau-label b {
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.hp-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.hp-track i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 0.25s ease, background 0.25s ease;
}

.stars-row {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(246, 234, 215, 0.28);
}

.stars-row .on {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(245, 185, 66, 0.65);
}

.hud-top-center {
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(16, 11, 9, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  max-width: 46vw;
}

.timer {
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.wave-name {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.boss-bar {
  margin-top: 4px;
  width: 170px;
  max-width: 40vw;
}

.boss-bar span {
  display: block;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fca5a5;
  margin-bottom: 3px;
}

.boss-bar .hp-track i {
  background: linear-gradient(90deg, #b91c1c, #f87171);
}

.hud-top-right {
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.coins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(16, 11, 9, 0.8);
  border: 1px solid rgba(245, 185, 66, 0.35);
  color: var(--gold);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(10px);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 14, 11, 0.72);
  color: var(--cream);
  font-size: 15px;
  backdrop-filter: blur(8px);
}

.team {
  top: calc(96px + env(safe-area-inset-top));
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(46vw, 190px);
}

.team-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(16, 11, 9, 0.66);
  border: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.team-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, var(--gold));
  flex: 0 0 auto;
}

.team-badge.self {
  border-color: rgba(245, 185, 66, 0.45);
  color: var(--cream);
}

.joystick {
  left: 18px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 2px solid rgba(246, 234, 215, 0.22);
  background: radial-gradient(circle at 50% 50%, rgba(246, 234, 215, 0.08), rgba(10, 7, 5, 0.4));
  backdrop-filter: blur(6px);
  touch-action: none;
}

.joystick .nub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe2a6, #e3a12d);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.04s linear;
}

.ability {
  right: 18px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid rgba(245, 185, 66, 0.5);
  background: radial-gradient(circle at 40% 30%, rgba(245, 185, 66, 0.3), rgba(50, 27, 8, 0.85));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--cream);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 0 26px rgba(245, 185, 66, 0.2);
  touch-action: none;
  overflow: hidden;
}

.ability .cd {
  position: absolute;
  inset: 0;
  background: conic-gradient(rgba(8, 5, 3, 0.72) calc(var(--cd, 0) * 1turn), transparent 0);
  pointer-events: none;
}

.ability .glyph {
  font-size: 24px;
  line-height: 1;
  z-index: 1;
}

.ability span.label {
  z-index: 1;
}

.ability.ready {
  animation: abilityPulse 2.4s infinite ease-in-out;
}

@keyframes abilityPulse {
  0%,
  100% {
    box-shadow: 0 0 22px rgba(245, 185, 66, 0.2);
  }
  50% {
    box-shadow: 0 0 34px rgba(245, 185, 66, 0.5);
  }
}

.turret-bar {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(16, 11, 9, 0.74);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.turret-slot {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px dashed rgba(246, 234, 215, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.turret-slot.filled {
  border-style: solid;
  border-color: rgba(245, 185, 66, 0.5);
  background: rgba(245, 185, 66, 0.08);
  color: var(--gold);
}

.turret-slot .lvl {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--cream);
}

.turret-slot .cost {
  font-size: 8px;
  color: var(--muted);
  margin-top: 2px;
}

.turret-slot.can-buy {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.player-name {
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 234, 215, 0.5);
  white-space: nowrap;
}

.wave-banner {
  top: 30%;
  left: 50%;
  transform: translate(-50%, -10px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(18, 12, 9, 0.9);
  border: 1px solid rgba(245, 185, 66, 0.45);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.wave-banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.damage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px 30px rgba(220, 38, 38, 0);
  transition: box-shadow 0.35s ease;
}

.damage-vignette.hit {
  box-shadow: inset 0 0 90px 30px rgba(220, 38, 38, 0.55);
  transition: box-shadow 0.05s ease;
}

/* ---------------------------------------------------------- overlays jeu */
.overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 6, 4, 0.82);
  backdrop-filter: blur(12px);
}

.overlay-panel.hidden {
  display: none !important;
}

.panel-card {
  width: min(480px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(42, 29, 21, 0.97), rgba(18, 13, 10, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.panel-card .sub {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.turret-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.turret-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  color: var(--cream);
}

.turret-option .emoji {
  font-size: 26px;
}

.turret-option .info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.turret-option .info b {
  font-size: 13px;
}

.turret-option .info small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.turret-option .price {
  color: var(--gold);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}

.turret-option:disabled {
  opacity: 0.45;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions .solid-btn,
.modal-actions .ghost-btn {
  flex: 1;
  justify-content: center;
}

.lobby-card {
  text-align: center;
}

.lobby-count {
  font-size: 46px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  margin: 8px 0;
}

.lobby-players {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lobby-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

/* --------------------------------------------------------------- fin */
#screen-end {
  background: radial-gradient(70% 60% at 50% 0%, rgba(60, 34, 10, 0.85), rgba(8, 6, 4, 0.94) 70%);
  overflow-y: auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  display: block;
}

.end-wrap {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}

.end-kicker {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.end-title {
  margin: 0;
  font-size: clamp(26px, 8vw, 40px);
  line-height: 1;
  letter-spacing: 0.01em;
}

.end-title.win {
  color: var(--gold);
}

.end-title.lose {
  color: #f87171;
}

.end-stars {
  display: flex;
  gap: 10px;
  font-size: 40px;
  line-height: 1;
  color: rgba(246, 234, 215, 0.18);
}

.end-stars .on {
  color: var(--gold);
  text-shadow: 0 0 24px rgba(245, 185, 66, 0.6);
  animation: starPop 0.5s ease both;
}

.end-stars .on:nth-child(2) {
  animation-delay: 0.15s;
}

.end-stars .on:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes starPop {
  from {
    transform: scale(0.4) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.end-score {
  font-size: 34px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.end-score small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.end-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}

.end-stats b {
  color: var(--cream);
}

.end-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}

.end-actions .solid-btn,
.end-actions .ghost-btn {
  width: 100%;
  justify-content: center;
}

.review-cta {
  width: 100%;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(245, 185, 66, 0.4);
  font-size: 12px;
  line-height: 1.5;
  color: var(--cream);
  text-decoration: none;
  text-align: center;
}

.review-cta b {
  color: var(--gold);
}

.leaderboard-card {
  width: 100%;
  max-width: 440px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard-card h3 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
}

.leaderboard-list .rank {
  width: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.leaderboard-list .who {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-list .pts {
  color: var(--gold);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.leaderboard-list .crown {
  color: var(--gold);
}

/* ------------------------------------------------------------ pause / net */
.pause-card {
  text-align: center;
}

.pause-card .pause-time {
  font-size: 40px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.net-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(8, 6, 4, 0.86);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(246, 234, 215, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: 86vw;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 14, 11, 0.95);
  border: 1px solid rgba(245, 185, 66, 0.35);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.warn {
  border-color: rgba(220, 38, 38, 0.55);
  color: #fecaca;
}

/* -------------------------------------------------------------- règles */
.howto-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.howto-list b {
  color: var(--cream);
}

@media (max-width: 520px) {
  .hud-top-left {
    width: 40vw;
  }
  .hud-top-center {
    max-width: 34vw;
    padding: 5px 10px;
  }
  .timer {
    font-size: 17px;
  }
  .wave-name {
    font-size: 7px;
  }
  .coins {
    padding: 7px 9px;
    font-size: 11px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .team {
    display: none;
  }
  .joystick {
    width: 104px;
    height: 104px;
  }
  .ability {
    width: 80px;
    height: 80px;
  }
  .turret-bar {
    bottom: calc(120px + env(safe-area-inset-bottom));
  }
  .player-name {
    display: none;
  }
  .end-stars {
    font-size: 34px;
  }
}

@media (max-height: 560px) {
  .home-title {
    font-size: 26px;
  }
  .home-bottom {
    padding-bottom: 10px;
  }
  .joystick {
    width: 88px;
    height: 88px;
  }
  .ability {
    width: 70px;
    height: 70px;
  }
}

/* --- correctifs HUD mobile mesurés en QA --- */
@media (max-width: 520px) {
  .hud-top-left { width: 37vw; }
  .plateau-card { padding: 6px 8px; }
  .plateau-label { font-size: 8px; }
  .hud-top-center { max-width: 36vw; padding: 4px 9px; }
  .timer { font-size: 16px; }
  .wave-name { font-size: 7px; letter-spacing: 0.08em; }
}

/* --- HUD mobile : deux rangées, plus de chevauchement --- */
.hud-tools { display: flex; gap: 6px; align-items: center; }

@media (max-width: 560px) {
  .hud-top-center {
    top: calc(10px + env(safe-area-inset-top));
    left: 12px;
    transform: none;
    align-items: flex-start;
    max-width: 58vw;
    padding: 5px 10px;
  }
  .hud-top-left {
    top: calc(66px + env(safe-area-inset-top));
    width: 44vw;
  }
  .hud-top-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
  .timer { font-size: 17px; }
  .plateau-label { font-size: 8px; }
  .stars-row { font-size: 11px; }
}

/* --- accueil mobile : lisibilité et cartes compactes --- */
@media (max-width: 759px) {
  .hero-card .tag,
  .hero-card .stats {
    display: none;
  }
  .hero-card .name {
    font-size: 13px;
  }
  .home-main {
    background: radial-gradient(90% 130% at 12% 50%, rgba(9, 6, 4, 0.78), rgba(9, 6, 4, 0.15) 68%, transparent);
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .home-title {
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.85);
  }
  .home-top .pill {
    white-space: nowrap;
    font-size: 9px;
    padding: 5px 8px;
  }
  .play-row {
    gap: 6px;
  }
  .play-row .solid-btn {
    min-width: 170px;
    flex: 1;
  }
  .play-row .ghost-btn {
    font-size: 11px;
    padding: 9px 10px;
  }
}

@media (max-width: 759px) {
  .hero-card .name { font-size: 12px; letter-spacing: -0.01em; }
  .hero-card .role { font-size: 7.5px; letter-spacing: 0.04em; }
  .hero-card .special { font-size: 8.5px; }
  .hero-card { padding: 10px 9px 9px; }
}
