/* Extras: tarjetas v2, grupos, responsive web */

/* ===== Poster ratio 5:4 (300×240) ===== */
.proj-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }

.proj-card-v2 {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--ink-100);
  overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.proj-card-v2:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.proj-poster {
  aspect-ratio: 63 / 50;
  width: 100%;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.proj-poster::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.18) 100%);
  pointer-events: none;
}
.proj-poster-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.01em;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  text-align: center;
  padding: 0 16px;
  position: relative;
  z-index: 1;
  text-wrap: balance;
}
.proj-badges {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
  z-index: 2;
}

.proj-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.proj-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink-900); line-height: 1.25; }
.proj-pitch {
  margin: 0; font-size: 13.5px; color: var(--ink-700); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.proj-actions { display: flex; gap: 8px; margin-top: 4px; }
.proj-action {
  width: 36px; height: 36px; border-radius: 8px; border: 0;
  background: var(--ink-900); color: white;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.proj-action:hover { background: var(--ink-700); }

/* ===== Appbar blanco con logo a color ===== */
.appbar-white {
  background: var(--white);
  padding: 16px var(--app-pad);
  min-height: 72px;
  border-bottom: 1px solid var(--ink-100);
}
.appbar-logo-color { height: 44px; width: auto; display: block; object-fit: contain; }

/* ===== Appbar con logo negro sobre fondo amarillo (gradient brand) ===== */
.appbar-brand {
  background: var(--gradient-brand);
  padding: 14px var(--app-pad);
  min-height: 64px;
}
.appbar-logo { height: 56px; width: auto; display: block; }
.appbar-icon-dark { color: var(--brand-navy) !important; }
.appbar-icon-dark:hover { background: rgba(0,0,0,.08); }

/* ===== Hero card info (texto explicativo, sin barra) ===== */
.hero-card-info {
  background: var(--gradient-brand);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  color: var(--white);
  box-shadow: var(--shadow-brand);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
}
.hero-card-info-icon {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: white;
}
.hero-card-info-icon svg { width: 22px; height: 22px; }
.hero-card-info-body { flex: 1; min-width: 0; }
.hero-card-info-text {
  font-size: 14px;
  line-height: 1.45;
  margin-top: 4px;
  color: rgba(255,255,255,.96);
}

/* ===== Hero card (sustituye a la antigua) ===== */
.hero-card {
  background: var(--gradient-brand);
  border-radius: var(--r-lg);
  padding: 18px;
  color: white;
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-brand);
}
.hero-card-title { font-weight: 800; font-size: var(--fs-lg); margin-top: 4px; }
.hero-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600;
}

/* ===== Group cards (3 por fila → 1 fila por categoría en web) ===== */
.groups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.group-card {
  --gt-color: var(--brand-magenta);
  --gt-tint: color-mix(in srgb, var(--gt-color) 7%, white);
  background: var(--gt-tint);
  border: 1.5px solid color-mix(in srgb, var(--gt-color) 35%, white);
  border-radius: var(--r-lg);
  padding: 14px 14px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  text-align: left;
  font-family: var(--font-sans);
  min-height: 150px;
}
.group-card:hover {
  transform: translateY(-2px);
  border-color: var(--gt-color);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--gt-color) 18%, transparent);
}
.group-card.is-complete {
  background: var(--gt-color);
  border-color: var(--gt-color);
  color: white;
}
.group-card.is-complete .group-card-pct,
.group-card.is-complete .group-card-pairs,
.group-card.is-complete .group-card-count { color: rgba(255,255,255,.95); }
.group-card.is-complete .group-card-bar { background: rgba(255,255,255,.3); }
.group-card.is-complete .group-card-bar > span { background: white; }
.group-card-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.group-card-progress-num {
  display: flex; align-items: baseline; gap: 10px;
  margin-top: 2px;
}
.group-card-pct {
  font-size: 28px; font-weight: 800; color: var(--ink-900);
  font-family: "Montserrat", sans-serif; line-height: 1;
}
.group-card-pairs {
  font-size: 12px; font-weight: 600; color: var(--ink-500);
}
.group-card-bar {
  height: 6px; border-radius: 999px; background: var(--ink-100); overflow: hidden;
}
.group-card-bar > span {
  display: block; height: 100%;
  background: var(--gt-color);
  transition: width var(--dur-base) var(--ease-out);
}
.group-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}
.group-card-count {
  font-size: 12px; font-weight: 600; color: var(--ink-500);
}
.group-card-cta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  color: white;
  background: var(--gt-color);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--gt-color) 35%, transparent);
}
.group-card-check {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--gt-color); color: white;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===== Group matrix (mantenida para GroupPicker grande) ===== */
.group-matrix-large { display: flex; flex-direction: column; gap: 14px; }
.group-row-large {
  display: grid; grid-template-columns: 80px repeat(3, 1fr); gap: 10px; align-items: stretch;
}
.group-cat-label {
  display: flex; align-items: center; justify-content: center;
  background: var(--gt-color, var(--brand-magenta));
  color: white; font-weight: 800;
  font-family: "Montserrat", sans-serif;
  letter-spacing: .04em; font-size: 13px;
  border-radius: var(--r-md);
  text-align: center; padding: 8px 4px;
  writing-mode: horizontal-tb;
}
.group-cell-large {
  --gt-color: var(--brand-magenta);
  background: var(--white);
  border: 1.5px solid var(--ink-100);
  border-radius: var(--r-md);
  padding: 14px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  font-family: var(--font-sans);
  text-align: left;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  min-height: 90px;
}
.group-cell-large:hover:not([disabled]) { transform: translateY(-1px); border-color: var(--gt-color); }
.group-cell-large[disabled] { opacity: .4; cursor: not-allowed; }
.group-cell-large-stage { font-weight: 800; color: var(--ink-900); font-size: 15px; letter-spacing: .02em; }
.group-cell-large-count { font-size: 12px; color: var(--ink-500); font-weight: 500; }
.group-cell-large-bar {
  width: 100%; height: 4px; border-radius: 999px; background: var(--ink-100); overflow: hidden;
  margin-top: auto;
}
.group-cell-large-bar > span { display: block; height: 100%; background: var(--gt-color); }

/* (los antiguos para compatibilidad; los oculto si no se usan) */
.group-matrix { display: flex; flex-direction: column; gap: 8px; }
.group-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.group-cell {
  background: var(--white); border: 1.5px solid; border-radius: var(--r-md);
  padding: 10px 8px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  font-family: "Montserrat", sans-serif;
  transition: transform var(--dur-fast) var(--ease-out);
}
.group-cell:hover:not([disabled]) { transform: translateY(-1px); }
.group-cell[disabled] { opacity: .4; cursor: not-allowed; }
.group-cell-cat {
  color: white; font-weight: 800; font-size: 10px; letter-spacing: .06em;
  padding: 3px 6px; border-radius: 4px; width: 100%;
}
.group-cell-stage { font-size: 11px; font-weight: 700; color: var(--ink-800); letter-spacing: .04em; }
.group-cell-count { font-size: 10px; color: var(--ink-500); }

/* ===== Responsive web (≥768px) — versión final, sin bezel ni toggle ===== */
@media (min-width: 768px) {
  /* El shell ocupa todo el ancho disponible en desktop */
  .app-shell { max-width: 100%; }

  /* Header blanco en web: más aire */
  .appbar-white {
    padding: 20px 40px;
    min-height: 88px;
  }
  .appbar-logo-color { height: 56px; }

  /* Header en web: full width, no constreñido */
  .appbar-brand {
    padding: 18px 40px;
    min-height: 76px;
  }
  .appbar-logo { height: 64px; }

  /* Contenido centrado pero header full */
  main {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding-left: 40px; padding-right: 40px;
  }
  main > section { padding-left: 0 !important; padding-right: 0 !important; }

  /* En web: 3 columnas (1 fila por categoría × 3 etapas) */
  .groups-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  /* Grupos en GroupPicker — formato matriz grande */
  .group-row-large { grid-template-columns: 100px repeat(3, 1fr); }

  .duel-grid {
    flex-direction: row; align-items: stretch; gap: 24px;
    max-width: 1000px; margin: 0 auto;
  }
  .duel-grid > .duel-card { flex: 1; }
  .duel-vs {
    margin: 0; align-self: center;
    width: 56px; height: 56px; font-size: 18px;
  }
  .proj-grid { grid-template-columns: repeat(3, 1fr); }

  .hero-card {
    flex-direction: row; align-items: center; gap: 24px;
    padding: 20px 28px;
  }
  .hero-card > div:first-child { flex-shrink: 0; }
  .hero-card .progress { flex: 1; max-width: 300px; }
  .hero-card-info {
    padding: 22px 28px;
    gap: 20px;
    margin-top: 0;
  }
  .hero-card-info-text { font-size: 15px; }
  .hero-card-info-icon { width: 48px; height: 48px; }
  .hero-card-info-icon svg { width: 26px; height: 26px; }

  /* Hero en web: saludo a la izquierda, card a la derecha */
  .home-hero {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
    align-items: center;
    padding-top: 32px !important;
    padding-bottom: 24px !important;
  }
}

/* TabBar de mentor: el menú del mentor solo tiene 2 pestañas
   (Grupos y Yo). El ranking se mantiene oculto hasta validarse. */
.tabbar.tabbar-2 { grid-template-columns: repeat(2, 1fr); }

/* ===========================================================
   Mentor TopBar (escritorio) — mismo lenguaje que AdminAppShell.
   La barra de pestañas inferior (tabbar) sigue siendo la
   navegación en móvil. Aquí solo se hace el switch responsive:
   - <768px  → tabbar abajo, topbar oculta.
   - ≥768px  → topbar arriba, tabbar oculta y appbar-brand del
               home oculto (lo sustituye la topbar).
   =========================================================== */
.mentor-topbar {
  display: none; /* por defecto oculta — se activa en escritorio */
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--gradient-brand);
  color: white;
  font-family: var(--font-sans);
}
.mentor-topbar img { height: 36px; }
.mentor-topbar .spacer { flex: 1; }

@media (min-width: 768px) {
  .mentor-topbar { display: flex; }
  /* En escritorio escondemos la barra inferior: la nav vive arriba. */
  .tabbar { display: none; }
  /* La cabecera de marca de Home queda redundante con la topbar → ocultar. */
  .app-shell > .appbar-brand,
  .app-shell main + .appbar-brand,
  .app-shell .appbar-brand { display: none; }
}

/* Cover real (Airtable 630x500) dentro de .proj-poster */
.proj-poster img.proj-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-poster .proj-poster-title { position: relative; z-index: 1; }
.proj-poster .proj-badges { z-index: 2; }

/* Admin: layout simple para tablas y secret_codes */
.admin-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.admin-table th, .admin-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--ink-100);
}
.admin-table th { white-space: nowrap; }
.admin-table th { color: var(--ink-600); font-weight: 600; background: var(--ink-50); }
.admin-table tr:hover td { background: rgba(0,0,0,.02); }
.code-pill {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--ink-50);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-weight: 700;
  letter-spacing: 1px;
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100; padding: 20px;
}
.modal-card {
  background: white; border-radius: var(--r-lg);
  max-width: 560px; width: 100%; max-height: 80vh; overflow: auto;
  padding: 24px;
}
