.profile-page {
  --profile-pad: clamp(1.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(circle at 78% 4%, rgba(184, 255, 44, .055), transparent 24rem),
    radial-gradient(circle at 15% 42%, rgba(91, 221, 241, .04), transparent 28rem),
    var(--void);
}
.profile-page [hidden] { display: none !important; }

.profile-topbar {
  position: relative; z-index: 11; background: rgba(8, 11, 13, .9);
  backdrop-filter: blur(16px);
}
.profile-main { width: min(1240px, 100%); min-height: calc(100vh - 164px); margin: 0 auto; }
.profile-eyebrow {
  margin: 0 0 .65rem; color: var(--lime); font: .58rem/1.3 var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
}

/* Loading mirrors the finished profile instead of showing a detached spinner. */
.profile-loading {
  min-height: 620px; padding: clamp(4rem, 8vw, 7rem) var(--profile-pad);
  display: grid; grid-template-columns: 96px 1fr; align-content: start; gap: 1.5rem;
}
.skeleton {
  display: block; border: 1px solid rgba(255, 255, 255, .04);
  background: linear-gradient(100deg, rgba(255,255,255,.035) 25%, rgba(255,255,255,.075) 45%, rgba(255,255,255,.035) 65%);
  background-size: 240% 100%; animation: profile-shimmer 1.4s ease-in-out infinite;
}
.skeleton-avatar { width: 96px; height: 96px; border-radius: 20px; }
.skeleton-copy { padding-top: .45rem; }
.skeleton-line, .skeleton-line-medium, .skeleton-line-short { height: 13px; margin-bottom: 1rem; border-radius: 2px; }
.skeleton-line { width: min(420px, 80%); height: 34px; }
.skeleton-line-medium { width: min(290px, 62%); }
.skeleton-line-short { width: 110px; }
.skeleton-card { grid-column: 1 / -1; height: 190px; margin-top: 3rem; border-radius: 4px; }
@keyframes profile-shimmer { to { background-position: -140% 0; } }

/* Signed-out state: one clear decision, no marketing hero. */
.profile-login {
  min-height: calc(100vh - 164px); padding: clamp(4rem, 9vw, 8rem) var(--profile-pad);
  display: grid; place-items: center;
}
.profile-login-card {
  width: min(570px, 100%); padding: clamp(2rem, 5vw, 4rem); border: 1px solid var(--line);
  background: rgba(15, 20, 23, .72); box-shadow: 22px 22px 0 rgba(184, 255, 44, .025);
}
.profile-login-mark {
  width: 62px; height: 62px; margin-bottom: 2.4rem; display: grid; place-items: center;
  border-radius: 15px; background: var(--lime); color: var(--void); font: 2rem/1 var(--display);
  transform: rotate(-3deg);
}
.profile-login h1 { max-width: 520px; font-size: clamp(3rem, 8vw, 5.7rem); line-height: .88; }
.profile-login-card > p:not(.profile-eyebrow, .profile-note) {
  max-width: 510px; margin: 1.6rem 0 2rem; color: #b8c0be; font-size: 1rem; line-height: 1.65;
}
.profile-primary-action {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.05rem 1.2rem; border: 1px solid var(--lime); background: var(--lime);
  color: var(--void); text-decoration: none; font: .64rem/1 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; transition: transform .2s ease, filter .2s ease;
}
.profile-primary-action:hover { filter: brightness(1.08); transform: translateY(-2px); }
.profile-primary-action:active { transform: translateY(0); }
.profile-primary-action[aria-disabled="true"] { border-color: var(--line); background: transparent; color: var(--muted); pointer-events: none; }
.profile-note { margin: .9rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

/* The account header behaves like a real profile, not a tournament landing page. */
.profile-account { padding: clamp(2.5rem, 6vw, 5.2rem) var(--profile-pad) 0; }
.profile-breadcrumb {
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem); display: flex; align-items: center; gap: .7rem;
  color: var(--muted); font: .56rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.profile-breadcrumb a { color: var(--muted); text-decoration: none; }
.profile-breadcrumb a:hover { color: var(--paper); }
.profile-breadcrumb span:last-child { color: var(--paper); }
.profile-identity {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: clamp(1.2rem, 3vw, 2.2rem);
}
.profile-avatar {
  position: relative; width: clamp(76px, 9vw, 104px); aspect-ratio: 1; overflow: hidden;
  display: grid; place-items: center;
  border-radius: 24%; background: var(--lime); color: var(--void); font: clamp(1.65rem, 4vw, 2.7rem)/1 var(--display);
  box-shadow: inset -10px -10px 0 rgba(0, 0, 0, .12), 0 16px 42px rgba(184, 255, 44, .08);
}
.profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-identity-copy { min-width: 0; }
.profile-identity h1 {
  max-width: 760px; overflow-wrap: anywhere; font-size: clamp(3rem, 7vw, 6rem);
  line-height: .86; letter-spacing: -.025em; text-transform: uppercase;
}
.profile-identity h1 span { display: inline; color: var(--paper); -webkit-text-stroke: 0; }
.profile-connected { margin: 1rem 0 0; color: #aeb7b5; font-size: .87rem; }
.profile-connected span {
  display: inline-block; width: 7px; height: 7px; margin-right: .55rem; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 12px rgba(184, 255, 44, .55);
}
#profile-logout {
  align-self: end; padding: .75rem .2rem; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; font: .55rem/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; transition: color .2s ease, border-color .2s ease;
}
#profile-logout:hover { border-color: var(--coral); color: var(--paper); }
#profile-logout:active { transform: translateY(1px); }

.profile-summary {
  margin: clamp(2.6rem, 6vw, 4.8rem) 0 0; display: grid; grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
}
.profile-summary div { min-height: 108px; padding: 1.25rem 0; display: flex; align-items: end; gap: .85rem; }
.profile-summary div + div { padding-left: clamp(1rem, 3vw, 2.5rem); border-left: 1px solid var(--line); }
.profile-summary dd { order: -1; margin: 0; color: var(--paper); font: clamp(2.3rem, 5vw, 3.7rem)/.8 var(--display); font-variant-numeric: tabular-nums; }
.profile-summary dt { padding-bottom: .2rem; color: var(--muted); font-size: .78rem; }

.profile-events { padding: clamp(4.5rem, 8vw, 7rem) var(--profile-pad) clamp(6rem, 10vw, 9rem); }
.profile-section-heading {
  margin-bottom: clamp(3rem, 6vw, 5rem); display: flex; justify-content: space-between;
  align-items: end; gap: 2rem;
}
.profile-section-heading h2 { font-size: clamp(3rem, 7vw, 5.7rem); }
.profile-section-heading > p { max-width: 390px; margin: 0; color: var(--muted); line-height: 1.6; }
.profile-registration-list { display: grid; gap: clamp(3.5rem, 7vw, 6rem); }
.profile-event-group > header {
  margin-bottom: 1.15rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between;
}
.profile-event-group > header h3 { font: 1.1rem/1 var(--body); font-weight: 600; }
.profile-event-group > header span { color: var(--muted); font: .75rem/1 var(--mono); }
.profile-event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }

.profile-event-card {
  --event-accent: var(--lime); min-width: 0; background: rgba(15, 20, 23, .8);
  display: grid; grid-template-rows: auto 1fr; border-bottom: 2px solid var(--event-accent);
  transition: transform .24s ease, background .24s ease;
}
.profile-event-card:hover { transform: translateY(-4px); background: rgba(19, 25, 28, .94); }
.profile-event-card.is-archived { --event-accent: var(--muted) !important; opacity: .78; }
.profile-event-card.is-archived:hover { opacity: 1; }
.profile-event-cover {
  position: relative; min-height: 190px; margin: 0; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--event-accent) 18%, #111719), #0b0f11);
}
.profile-event-cover > span { color: rgba(255,255,255,.13); font: 8rem/.8 var(--display); }
.profile-event-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.profile-event-card:hover .profile-event-cover img { transform: scale(1.025); }
.profile-event-cover::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(8, 11, 13, .62)); pointer-events: none; }
.profile-event-content { min-width: 0; padding: clamp(1.35rem, 3vw, 2rem); display: flex; flex-direction: column; }
.profile-event-content > header { position: relative; padding-right: 7rem; }
.profile-event-game { margin: 0 0 .8rem; color: var(--event-accent); font: .55rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.profile-event-card h3 { font: clamp(2rem, 4vw, 3.35rem)/.9 var(--display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.profile-event-status {
  position: absolute; top: 0; right: 0; max-width: 6.5rem; color: #b8c0be;
  font: .48rem/1.35 var(--mono); letter-spacing: .08em; text-align: right; text-transform: uppercase;
}
.profile-event-facts { margin: 1.7rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.5rem; }
.profile-event-facts div { min-width: 0; }
.profile-event-facts dt { margin-bottom: .35rem; color: var(--muted); font-size: .7rem; }
.profile-event-facts dd { margin: 0; color: var(--paper); font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.profile-event-bio { margin: 1.4rem 0 0; padding-top: 1.15rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; line-height: 1.55; }
.profile-event-content footer { margin-top: auto; padding-top: 1.8rem; }
.profile-event-link { color: var(--event-accent); text-decoration: none; font: .59rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.profile-event-link:hover { color: var(--paper); }
.profile-event-history { color: var(--muted); font: .55rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; }

.profile-empty {
  min-height: 330px; padding: clamp(2rem, 5vw, 4rem); border-block: 1px solid var(--line);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
}
.profile-empty-mark {
  width: 92px; height: 92px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 22px; color: var(--line); font: 3rem/1 var(--display); transform: rotate(-3deg);
}
.profile-empty h3 { max-width: 690px; font: clamp(2rem, 5vw, 3.7rem)/.93 var(--display); }
.profile-empty p { max-width: 550px; margin: 1rem 0 1.5rem; color: var(--muted); line-height: 1.55; }
.profile-empty a { color: var(--lime); text-decoration: none; font: .6rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; }

.profile-system-state {
  min-height: 62vh; padding: 4rem var(--profile-pad); display: flex; align-items: center;
  justify-content: center; gap: 1rem; color: var(--muted); text-align: left;
}
.profile-system-state > span { color: var(--coral); font: 3.2rem/1 var(--display); }
.profile-system-state strong { color: var(--paper); font-size: 1.15rem; }
.profile-system-state p { margin: .55rem 0 0; }
.profile-footer {
  min-height: 82px; padding: 1rem max(var(--profile-pad), calc((100vw - 1240px) / 2 + var(--profile-pad)));
  border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: .76rem;
}
.profile-footer a { color: var(--muted); text-decoration: none; }
.profile-footer a:hover { color: var(--paper); }

@media (max-width: 820px) {
  .profile-event-grid { grid-template-columns: 1fr; }
  .profile-event-cover { min-height: 220px; }
}
@media (max-width: 650px) {
  .profile-topbar { height: auto; min-height: 76px; padding-block: .65rem; gap: .6rem; }
  .profile-topbar .broadcast, .profile-topbar .primary-nav { display: none; }
  .profile-topbar .topbar-utilities { margin-left: auto; }
  .profile-loading { grid-template-columns: 68px 1fr; min-height: 500px; padding-top: 3rem; gap: 1rem; }
  .skeleton-avatar { width: 68px; height: 68px; border-radius: 15px; }
  .profile-login { min-height: calc(100dvh - 158px); padding-block: 3.5rem; }
  .profile-login-card { padding: 2rem 1.35rem; box-shadow: 10px 10px 0 rgba(184, 255, 44, .025); }
  .profile-login-mark { margin-bottom: 2rem; }
  .profile-breadcrumb { margin-bottom: 2.5rem; }
  .profile-identity { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .profile-avatar { width: 72px; }
  .profile-identity h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .profile-connected { margin-top: .75rem; font-size: .76rem; }
  #profile-logout { grid-column: 1 / -1; justify-self: start; margin-top: .5rem; }
  .profile-summary { grid-template-columns: 1fr; }
  .profile-summary div { min-height: 72px; justify-content: space-between; }
  .profile-summary div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .profile-summary dd { order: 2; font-size: 2.5rem; }
  .profile-section-heading { display: block; }
  .profile-section-heading > p { margin-top: 1rem; }
  .profile-event-cover { min-height: 175px; }
  .profile-event-content > header { padding-right: 0; }
  .profile-event-status { position: static; display: block; margin-top: .75rem; max-width: none; text-align: left; }
  .profile-event-facts { grid-template-columns: 1fr; }
  .profile-empty { grid-template-columns: 1fr; }
  .profile-empty-mark { width: 70px; height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .profile-event-card, .profile-event-cover img, .profile-primary-action { transition: none; }
}

/* ------------------------------------------------- lo que pasa en el torneo

   El perfil decía quién eres y a qué te habías apuntado. Lo que uno viene a
   mirar de verdad es contra quién juega, cómo va su equipo y con quién. */

.profile-next {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--event-accent, var(--lime));
  background: rgba(255, 255, 255, .03);
}
.profile-next-label {
  margin: 0 0 .35rem;
  color: var(--muted);
  font: .5rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.profile-next-rival {
  margin: 0;
  font: 1.35rem/1.1 var(--display);
  text-transform: uppercase;
}
.profile-next-detail {
  margin: .45rem 0 0;
  color: var(--muted);
  font: .55rem/1.4 var(--mono);
  letter-spacing: .06em;
}

.profile-standing {
  margin-top: .8rem;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem .8rem;
}
.profile-standing b { font: 1.5rem/1 var(--display); }
.profile-standing span { color: var(--muted); font: .6rem/1 var(--mono); letter-spacing: .08em; }
.profile-standing small {
  flex-basis: 100%;
  color: var(--gold);
  font: .5rem/1.4 var(--mono);
  letter-spacing: .06em;
}
.profile-standing.is-qualified { border-color: var(--lime); }
.profile-standing.is-qualified b { color: var(--lime); }

.profile-roster { margin-top: .8rem; }
.profile-roster-title {
  margin: 0 0 .5rem;
  color: var(--muted);
  font: .5rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.profile-roster ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.profile-roster li {
  padding: .35rem .6rem;
  border: 1px solid var(--line);
  font-size: .8rem;
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
}
.profile-roster li.is-captain { border-color: var(--event-accent, var(--lime)); }
.profile-roster li span {
  color: var(--muted);
  font: .45rem/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.profile-event-link.is-secondary { opacity: .75; }
.profile-event-link.is-secondary:hover { opacity: 1; }

@media (max-width: 600px) {
  .profile-next-rival { font-size: 1.15rem; }
  .profile-roster ul { gap: .3rem; }
}
