/* ════════════════════════════════
   PARTICIPANT — estilos exclusivos de #screen-participant
   (bottom-nav móvil y tarjetas de navegación de escritorio)
   ════════════════════════════════ */

/* ── BOTTOM NAV (mobile participant) ── */
.bottom-nav {
  display: none; /* shown only on mobile via media query */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7,18,51,0.97);
  border-top: 1px solid var(--border2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner {
  display: flex;
  height: 64px;
}

.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.bnav-btn .bnav-icon { font-size: 22px; line-height: 1; }
.bnav-btn.active, .bnav-btn:hover { color: var(--accent2); }
.bnav-btn.active .bnav-icon { filter: drop-shadow(0 0 6px var(--accent-glow)); }

/* ── PARTICIPANT NAV CARDS (desktop/tablet) ── */
.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.nav-card {
  background: rgba(13,29,74,0.7);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  color: var(--text);
}

.nav-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,143,255,0.2);
}

.nav-card .nav-icon { font-size: 40px; margin-bottom: 10px; }
.nav-card .nav-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; }
.nav-card .nav-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Responsivo: en móvil se muestra bottom-nav y se ocultan las nav-cards */
@media (max-width: 640px) {
  .bottom-nav { display: block; }
  .has-bottom-nav { padding-bottom: 64px; }
  .nav-grid { display: none; }
  /* La targeta GALERIA viu al costat de la card de foto; en mòbil s'apila a sota */
  .photo-gallery-row { grid-template-columns: 1fr; }
}

/* ── Fila: card "La meva foto" (meitat) + targeta GALERIA (meitat) ── */
.photo-gallery-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;
}
.photo-gallery-row > .card { margin-bottom: 0; }
.photo-gallery-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ════════════════════════════════
   GALERIA — filtres, capçaleres de grup i mosaic
   ════════════════════════════════ */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.gallery-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  min-width: 140px;
}
.gallery-filter select {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface, #16243a);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.gallery-group-header {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--accent2);
  padding: 6px 12px;
  border-radius: 6px;
  margin: 18px 0 10px;
}
.gallery-mosaic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.gallery-photo {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #16243a);
  border: 1px solid var(--border2);
  transition: transform 0.15s, border-color 0.15s;
}
.gallery-photo:hover { transform: translateY(-2px); border-color: var(--accent); }
.gallery-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.gallery-photo-meta {
  padding: 6px 8px;
  font-family: Arial, Helvetica, sans-serif;
}
.gallery-photo-caption {
  font-size: 12px;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.gallery-photo-author {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ════════════════════════════════
   PANELL EMBEGUT (App Resultats d'Enric) — PANTALLA COMPLETA
   L'iframe omple tota la finestra; només sura a sobre el botó ← Tornar (marge
   esquerre). La resta de controls de FEM queden a la pàgina principal. S'activa
   amb la classe body.embedded-fullscreen (la posa openEmbedded; la treu
   _hideAllParticipantPanels en sortir per qualsevol via de navegació).
   ════════════════════════════════ */
#iframe-resultats { display: block; border: none; }

body.embedded-fullscreen #participant-panel-embedded {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: 0;
}
/* L'iframe omple la finestra. --iframe-zoom agranda el contingut d'Enric:
   1 = mida normal; puja a 1.1 / 1.15 / 1.2... per fer-lo més gran. */
body.embedded-fullscreen #iframe-resultats {
  --iframe-zoom: 1.15;
  width: calc(100vw / var(--iframe-zoom));
  height: calc(100dvh / var(--iframe-zoom));
  transform: scale(var(--iframe-zoom));
  transform-origin: top left;
}
/* Botó ← Tornar surant al marge esquerre, a sobre de l'iframe */
body.embedded-fullscreen #participant-panel-embedded > div:first-child {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 1002;
  margin: 0;
}
/* Mida del botó ← Tornar en mode pantalla completa (ajustable) */
body.embedded-fullscreen #participant-panel-embedded > div:first-child .btn {
  font-size: 15px;
  padding: 10px 18px;
}
