/* ==========================================================================
   Estilos específicos para la app de evaluación
   ========================================================================== */

/* Phone frame para mostrar mockups en desktop */
.phone-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.phone-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.phone-bezel {
  width: 380px;
  height: 780px;
  border-radius: 44px;
  background: #0F172A;
  padding: 12px;
  box-shadow: 0 30px 60px rgba(15,23,42,.18), 0 8px 16px rgba(15,23,42,.10), inset 0 0 0 2px #1E293B;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 26px;
  background: #000;
  border-radius: 999px;
  z-index: 5;
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: var(--white);
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-screen > * { flex-shrink: 0; }

/* Cuando la app vive a pantalla completa (no en frame) */
.app-fullscreen {
  width: 100vw; min-height: 100dvh;
  background: var(--ink-100);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
@media (max-width: 480px) {
  .app-fullscreen { padding: 0; }
  .phone-bezel { width: 100vw; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; }
  .phone-notch { display: none; }
  .phone-screen { border-radius: 0; }
}

/* ---------- DUEL ---------- */
.duel-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.duel-card {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.duel-card.is-dim { opacity: .35; transform: scale(.97); }
.duel-card.is-winner { transform: scale(1.02); box-shadow: var(--shadow-brand); }

.duel-card-empty {
  background: var(--ink-50);
  border: 2px dashed var(--ink-200);
  box-shadow: none;
}

.duel-poster {
  height: 110px;
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 10px;
}
.duel-poster-tag {
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(255,255,255,.95);
  color: var(--brand-navy);
  padding: 4px 8px;
  border-radius: var(--r-pill);
}
.duel-play {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(15,23,42,.5);
  color: white;
  border: 0;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.duel-body {
  padding: 14px 14px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.duel-body > .proj-actions {
  margin-top: auto;
  padding-top: 10px;
}
.duel-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-extrabold);
  color: var(--brand-navy);
  line-height: 1.2;
  margin-bottom: 4px;
}
.duel-team {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-bottom: 8px;
}
.duel-pitch {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--ink-700);
  line-height: 1.45;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.duel-vote {
  width: 100%;
  border: 0;
  color: white;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter var(--dur-fast) var(--ease-out);
}
.duel-vote:hover { filter: brightness(1.08); }
.duel-vote:active { filter: brightness(.95); }
.duel-vote[disabled] { background: var(--ink-200) !important; cursor: not-allowed; }

.duel-vs {
  align-self: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-extrabold);
  color: var(--brand-magenta);
  letter-spacing: .04em;
  margin: -10px 0;
  z-index: 2;
  border: 2px solid white;
  background: var(--gradient-brand);
}
.duel-vs span { color: white; }

/* ---------- FILTER ---------- */
.filter-trigger {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  background: var(--ink-100);
  border: 0;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--ink-700);
  cursor: pointer;
}
.filter-trigger b { color: var(--brand-navy); }
.filter-panel {
  margin-top: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1.5px solid var(--ink-200);
  background: var(--white);
  color: var(--ink-700);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.chip.is-active { background: var(--brand-navy); color: white; border-color: var(--brand-navy); }
.chip-cat-dreamers.is-active { background: var(--cat-dreamers); border-color: var(--cat-dreamers); }
.chip-cat-makers.is-active   { background: var(--cat-makers);   border-color: var(--cat-makers); }
.chip-cat-coders.is-active   { background: var(--cat-coders);   border-color: var(--cat-coders); }
.chip-cat-gamers.is-active   { background: var(--cat-gamers);   border-color: var(--cat-gamers); }

/* ---------- HOME ---------- */
.cat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.cat-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1.5px solid var(--ink-100);
}
.cat-tile-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- DETAIL ---------- */
.resource-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  cursor: pointer;
  text-decoration: none; color: inherit;
}
.resource-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---------- RANKING ---------- */
.rank-tabs {
  display: flex; gap: 4px;
  background: var(--ink-100);
  padding: 4px;
  border-radius: var(--r-pill);
  margin-bottom: 14px;
  overflow-x: auto;
}
.rank-tab {
  border: 0; background: transparent;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--ink-600);
  cursor: pointer;
  white-space: nowrap;
}
.rank-tab.is-active {
  background: var(--white);
  color: var(--brand-navy);
  box-shadow: var(--shadow-xs);
}

.podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  align-items: end;
  margin: 6px 0 24px;
}
.podium-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.podium-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px; border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid var(--ink-100);
  width: 100%;
  min-height: 92px;
}
.podium-bar {
  width: 100%;
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: var(--fw-extrabold);
  font-size: 22px;
}

.rank-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  cursor: pointer;
}
.rank-pos {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.rank-row:nth-child(1) .rank-pos { background: var(--gradient-brand); color: white; }
.rank-row:nth-child(2) .rank-pos { background: linear-gradient(180deg,#CBD5E1,#94A3B8); color: white; }
.rank-row:nth-child(3) .rank-pos { background: linear-gradient(180deg,#FDBA74,#F59E0B); color: white; }

/* ---------- PROFILE ---------- */
.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  text-align: center;
}
.stat { padding: 8px; }
.stat-num {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1;
}
.stat-label { font-size: var(--fs-xs); color: var(--ink-500); margin-top: 4px; }

.row-action {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--ink-800);
  cursor: pointer;
  text-align: left;
}

/* ============================================================
   DESIGN SYSTEM CATALOG (página de tokens / componentes)
   ============================================================ */
.ds-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  font-family: var(--font-sans);
  color: var(--ink-800);
}
.ds-hero {
  background: var(--gradient-brand);
  color: white;
  border-radius: var(--r-2xl);
  padding: 36px 32px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.ds-hero h1 {
  font-size: 44px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.ds-hero p { margin: 0; font-size: 17px; opacity: .92; max-width: 600px; line-height: 1.5; }
.ds-hero img { position: absolute; right: 24px; top: 24px; height: 56px; }

.ds-section { margin-bottom: 56px; }
.ds-section-title {
  font-size: 28px; font-weight: 800; color: var(--brand-navy);
  letter-spacing: -.015em; margin: 0 0 6px;
}
.ds-section-sub { color: var(--ink-600); margin: 0 0 20px; }

.ds-grid { display: grid; gap: 14px; }
.ds-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ds-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ds-grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) {
  .ds-grid-3, .ds-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .ds-page { padding: 24px 16px 60px; }
  .ds-hero h1 { font-size: 30px; }
}

.ds-card {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid var(--ink-100);
  padding: 18px;
}

.swatch {
  height: 86px;
  border-radius: var(--r-md);
  margin-bottom: 10px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.swatch-name { font-weight: 700; color: var(--brand-navy); font-size: 14px; }
.swatch-val  { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--ink-500); }

.type-spec {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--ink-100);
  gap: 16px;
}
.type-spec:last-child { border-bottom: 0; }
.type-spec-meta { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--ink-500); flex-shrink: 0; }

.token-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--ink-100);
}
.token-row:last-child { border-bottom: 0; }
.token-vis {
  background: var(--brand-magenta);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.token-name { font-weight: 700; color: var(--brand-navy); font-size: 14px; flex: 1; }
.token-val { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--ink-500); }

.shadow-demo {
  width: 100%; height: 80px;
  background: white;
  border-radius: var(--r-md);
  margin-bottom: 10px;
}

.ds-anchor-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-100);
  padding: 12px 32px;
  margin: 0 -32px 24px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.ds-anchor-nav a {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-600);
}
.ds-anchor-nav a:hover { background: var(--ink-100); color: var(--brand-navy); }

/* Demo blocks */
.demo-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
