* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --text: #1c1917;
  --text-soft: #78716c;
  --accent: #0d9488;
  --accent-light: #ccfbf1;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --online: #22c55e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* ---- LOGIN ---- */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2.5rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-card h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.login-card .subtitle {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-card input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}

.login-card input:focus {
  border-color: var(--accent);
}

.avatar-caption {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.avatar-picker {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.avatar-picker canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: #f5f5f4;
  transition: border-color 0.15s, background 0.15s;
}

.avatar-picker canvas:hover {
  border-color: #d6d3d1;
}

.avatar-picker canvas.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  min-height: 1.2em;
}

.login-card button {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-card button:hover {
  opacity: 0.9;
}

.login-card .btn-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.login-card .btn-link:hover {
  text-decoration: underline;
}

/* ---- MAIN : header + monde + barre ---- */

#main-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid #e7e5e4;
  flex: none;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.my-badge {
  font-size: 0.8rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 500;
}

.more-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.more-item:hover {
  background: #f5f5f4;
}

.more-item.active {
  background: #fef3c7;
  color: #b45309;
  font-weight: 600;
}

.more-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Le wizz : tout l'ecran tremble */
@keyframes wizz {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-10px, 4px); }
  20% { transform: translate(9px, -6px); }
  30% { transform: translate(-8px, -3px); }
  40% { transform: translate(10px, 5px); }
  50% { transform: translate(-6px, 7px); }
  60% { transform: translate(8px, -4px); }
  70% { transform: translate(-9px, 2px); }
  80% { transform: translate(6px, -7px); }
  90% { transform: translate(-4px, 3px); }
}

@keyframes wizz-soft {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}

#main-screen.wizz {
  animation: wizz 0.9s ease-in-out;
}

#main-screen.wizz-soft {
  animation: wizz-soft 0.4s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  #main-screen.wizz {
    animation: wizz-soft 0.9s ease-in-out;
  }
}

.presence-mic {
  display: inline-flex;
  color: #fecaca;
}

#notif-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  background: var(--card);
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
}

#notif-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#notif-btn.granted {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ---- STATUT (header) ---- */

.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #15803d;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
}

.status-btn.busy {
  border-color: #fecaca;
  background: var(--danger-light);
  color: #b91c1c;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  flex-shrink: 0;
}

.status-btn.busy .status-dot,
.room-member.busy .status-dot {
  background: var(--danger);
}

/* ---- HALL DES SALONS ---- */

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rooms-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.rooms-inner {
  max-width: 720px;
  margin: 0 auto;
}

.rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rooms-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---- Modale "Nouveau salon" ---- */

.modal {
  width: min(360px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(28, 25, 23, 0.4);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.25rem;
}

.modal-body h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-body input {
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.modal-body input:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-modal-cancel {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: var(--text-soft);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-cancel:hover {
  background: #f5f5f4;
  color: var(--text);
}

.btn-create-room {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-create-room:hover {
  opacity: 0.9;
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.room-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
  border-left: 3px solid transparent;
}

.room-card:hover {
  box-shadow: var(--shadow-lg);
}

.room-card.room-active {
  border-left-color: var(--accent);
}

.room-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  gap: 0.75rem;
}

.room-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.room-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.room-count {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.btn-room-action {
  padding: 0.4rem 0.9rem;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.btn-room-action.btn-join {
  background: var(--accent);
  color: white;
}

.btn-room-action.btn-confirm {
  background: #f59e0b;
  max-width: 55%;
  text-align: right;
}

.btn-room-action.btn-leave {
  background: var(--danger);
  color: white;
}

.btn-room-action:hover {
  opacity: 0.9;
}

.room-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.room-menu-wrap {
  position: relative;
}

.btn-room-more {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-room-more:hover {
  background: #f5f5f4;
  color: var(--text);
}

.room-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  padding: 0.35rem;
  background: var(--card);
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 30;
}

.room-menu .more-item.danger {
  color: var(--danger);
}

.room-menu .more-item.danger:hover:not(:disabled) {
  background: var(--danger-light);
}

.room-rename {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.2rem 0.5rem;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  outline: none;
  max-width: 260px;
}

/* ---- Scene d'un salon : un personnage par personne, a l'horizontale ---- */

.room-scene {
  position: relative;
  height: 92px;
  margin: 0 1.25rem 1rem;
  border-radius: 10px;
  background: linear-gradient(to bottom, #f5f5f4 0%, #f5f5f4 72%, #e7e5e4 72%, #d6d3d1 100%);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* Animations d'arrivee seulement a la creation (classe retiree ensuite) :
   renderRooms deplace la bande d'une carte a l'autre, ce qui les relancerait */
.room-scene.opening {
  animation: scene-open 0.35s ease-out;
}

.room-scene.mine {
  background: linear-gradient(to bottom, #f0fdfa 0%, #f0fdfa 72%, #99f6e4 72%, #5eead4 100%);
  cursor: crosshair;
}

@keyframes scene-open {
  from { height: 0; margin-bottom: 0; opacity: 0; }
  to { height: 92px; opacity: 1; }
}

.scene-char {
  position: absolute;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translateX(-50%);
  transition: left 0.15s linear;
  cursor: pointer;
}

.scene-char.arriving {
  animation: char-in 0.3s ease-out;
}

.scene-char.me {
  transition: none;
  cursor: default;
  z-index: 2;
}

@keyframes char-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.scene-sprite {
  width: 48px;
  height: 44px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Il parle : son prenom s'entoure d'un halo */
.scene-name {
  transition: box-shadow 0.12s;
}

.scene-char.speaking .scene-name {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.45);
}

.scene-name {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 96px;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #57534e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-char.me .scene-name {
  background: var(--accent);
}

.scene-char.busy .scene-name {
  background: #d97706;
}

.scene-name .presence-mic {
  color: #fecaca;
}

/* Wizz : une petite bulle au-dessus de la tete, au survol ou au tap */
.scene-wizz {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  padding: 0.1rem 0.5rem;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.scene-char:hover .scene-wizz,
.scene-char.open .scene-wizz {
  display: block;
}

.scene-wizz:disabled {
  opacity: 0.5;
  cursor: default;
}

.scene-char.shake .scene-sprite {
  animation: wizz-soft 0.3s ease-in-out 3;
}

/* Saut (espace) : "translate" se cumule avec le transform qui centre le personnage */
.scene-char.jumping {
  animation: jump 0.48s ease-out;
}

@keyframes jump {
  0%, 100% { translate: 0 0; animation-timing-function: ease-out; }
  45% { translate: 0 -22px; animation-timing-function: ease-in; }
  85% { translate: 0 1px; }
}

/* Bombe a eau (touche K) : un ballon bleu qui vole en tournant */
.scene-char.throwing .scene-sprite {
  animation: throw 0.3s ease-out;
}

@keyframes throw {
  30% { transform: translateY(-4px) scale(1.05); }
}

.water-bomb {
  position: fixed;
  z-index: 50;
  width: 12px;
  height: 14px;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 30%, #e0f2fe 0 18%, #38bdf8 40%, #0369a1 100%);
  box-shadow: 0 1px 2px rgba(3, 105, 161, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.water-bomb::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: #0369a1;
}

.water-splash {
  position: absolute;
  z-index: 3;
  width: 0;
  height: 0;
  pointer-events: none;
}

.water-splash::before {
  content: "";
  position: absolute;
  left: -14px;
  top: -6px;
  width: 28px;
  height: 12px;
  border: 2px solid #38bdf8;
  border-radius: 50%;
  animation: splash-ring 0.5s ease-out forwards;
}

.water-splash span {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  animation: splash-drop 0.6s ease-out forwards;
}

@keyframes splash-ring {
  from { transform: scale(0.3); opacity: 1; }
  to { transform: scale(1.8); opacity: 0; }
}

@keyframes splash-drop {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.4); opacity: 0; }
}

.scene-char.soaked .scene-sprite {
  filter: sepia(1) hue-rotate(170deg) saturate(3) brightness(0.95);
  transition: filter 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .room-scene, .scene-char { animation: none; }
  .scene-char { transition: none; }
}

.lobby-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.lobby-list {
  margin-top: 1.25rem;
}

.lobby-title {
  margin-right: 0.25rem;
}

.room-member {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.3rem 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f5f5f4;
  color: var(--text);
}

.room-member.me {
  padding-right: 0.55rem;
}

.chip-wizz {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid #e7e5e4;
  border-radius: 999px;
  background: var(--card);
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.chip-wizz:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip-wizz:disabled {
  opacity: 0.4;
  cursor: default;
  border-color: #e7e5e4;
  color: var(--text-soft);
}

.btn-mute:disabled {
  opacity: 0.35;
  cursor: default;
}

.world-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
  color: #fff;
  z-index: 50;
  text-align: center;
  padding: 2rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.overlay-btn {
  margin-top: 0.75rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.overlay-btn:hover {
  opacity: 0.9;
}

/* ---- BARRE DE CONTROLE ---- */

.active-bar {
  flex: none;
  background: var(--card);
  border-top: 1px solid #e7e5e4;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 20;
}

.active-bar-status {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.group-status {
  font-size: 0.8rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-status.active {
  color: var(--accent);
  font-weight: 600;
}

.mic-warning {
  font-size: 0.72rem;
  color: var(--danger);
}

.active-bar-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-mute {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-mute:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-mute.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-mute.muted {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-leave-all {
  padding: 0.5rem 0.8rem;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn-leave-all:hover {
  opacity: 0.9;
}

.mic-select {
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  padding: 0.3rem 0.5rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  outline: none;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s;
}

.mic-select:hover,
.mic-select:focus {
  border-color: var(--accent);
}

/* ---- AUDIO LEVEL INDICATORS ---- */

.audio-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.audio-level-local {
  background: rgba(34, 197, 94, 0.1);
}

.audio-level-remote {
  background: rgba(13, 148, 136, 0.1);
}

.audio-indicator-icon {
  flex-shrink: 0;
}

.audio-level-local .audio-indicator-icon {
  color: var(--online);
}

.audio-level-remote .audio-indicator-icon {
  color: var(--accent);
}

.audio-indicator-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.audio-level-local .audio-indicator-label {
  color: var(--online);
}

.audio-level-remote .audio-indicator-label {
  color: var(--accent);
}

.audio-level {
  width: 40px;
  height: 4px;
  background: #e7e5e4;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.audio-level-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.08s ease-out;
}

.audio-level-local .audio-level-bar {
  background: var(--online);
}

.audio-level-remote .audio-level-bar {
  background: var(--accent);
}

/* ---- Video (camera + partage d'ecran) : panneau flottant ---- */

.video-area {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 300px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  overflow-y: auto;
  z-index: 5;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.video-tile {
  position: relative;
  background: #1c1917;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #1c1917;
}

.video-tile.camera video {
  object-fit: cover;
}

.video-tile.local.camera video {
  transform: scaleX(-1);
}

.video-tile-label {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  pointer-events: none;
}

.video-tile:fullscreen video {
  object-fit: contain;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 640px) {
  .login-card {
    padding: 2rem 1.5rem;
  }

  header {
    padding: 0.6rem 0.9rem;
  }

  .header-right {
    gap: 0.35rem;
  }

  .active-bar {
    padding: 0.5rem 0.6rem;
    gap: 0.4rem;
  }

  .active-bar-status {
    display: none;
  }

  .audio-indicator-label {
    display: none;
  }

  .mic-select {
    max-width: 100px;
    font-size: 0.7rem;
  }

  .video-area {
    width: 180px;
  }

  .rooms-view {
    padding: 1rem 0.75rem;
  }

  .room-card-header {
    flex-wrap: wrap;
  }

  .status-btn .status-label {
    display: none;
  }
}

/* Overlay de diagnostic (index.html?debug) : lisible sur un telephone, ne gene pas les tapotements */
.debug-overlay {
  position: fixed;
  top: 52px;
  left: 6px;
  z-index: 9999;
  max-width: calc(100vw - 12px);
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: 6px 8px;
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #e8ffe8;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}
