/* Estilos específicos de vistas (grupo c): clubes, club y ajustes
   Prefijos: clb- (clubes), stg- (ajustes), c- (selectores compartidos) */

/* Iconos dentro de pills (rol, privado…) */
.pill > svg { width: 12px; height: 12px; flex: none; }

.clb-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.clb-block { display: block; }

/* ---------- Escudo emoji del club ---------- */
.clb-emoji {
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 23px; line-height: 1;
  background: color-mix(in srgb, var(--c, var(--amber)) 26%, var(--surface-2));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c, var(--amber)) 50%, transparent);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.clb-emoji.lg { width: 60px; height: 60px; border-radius: 20px; font-size: 32px; }
.clb-emoji.xl { width: 76px; height: 76px; border-radius: 24px; font-size: 42px; }
@media (min-width: 700px) { .clb-emoji.xl { width: 104px; height: 104px; border-radius: 32px; font-size: 58px; } }

/* ---------- Lista de clubes ---------- */
.clb-head-actions { gap: 8px; }
.clb-lbl-short { display: none; }
@media (max-width: 559px) {
  .clb-head-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .clb-head-actions .btn { padding: 0 12px; }
  .clb-lbl-long { display: none; }
  .clb-lbl-short { display: inline; }
}

.clb-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }

.clb-card {
  --c: var(--amber);
  display: flex; flex-direction: column; min-width: 0;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--text);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.clb-card:hover { color: var(--text); transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--c) 70%, transparent); }
.clb-card:active { transform: translateY(-1px) scale(.99); }
.clb-card:focus-visible { outline-offset: 3px; border-radius: var(--r-lg); }
.clb-card-banner {
  position: relative; height: 108px; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(circle at 50% 130%, color-mix(in srgb, var(--c) 65%, transparent), transparent 68%),
    linear-gradient(135deg, color-mix(in srgb, var(--c) 34%, #1b1814), color-mix(in srgb, var(--c) 8%, #14110e));
}
.clb-card-banner::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .03) 0 10px, transparent 10px 20px);
}
.clb-card-emoji { position: relative; font-size: 56px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); transition: transform .4s var(--ease-spring); }
.clb-card:hover .clb-card-emoji { transform: scale(1.08) rotate(-6deg); }
.clb-card-tags { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.clb-card-tags .pill { background-color: rgba(14, 12, 10, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.clb-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.clb-card-body h3 { font-size: 18px; }
.clb-card-desc { margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.clb-row { gap: 12px; }
.clb-row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: var(--text); }
.clb-row-main:hover { color: var(--text); }
.clb-row-main:hover .title { color: var(--amber-2); }

/* Pitch (sin clubes) */
.clb-pitch > * { position: relative; z-index: 1; }
.clb-pitch h2 { font-size: clamp(22px, 5vw, 28px); }
.clb-pitch-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .clb-pitch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.clb-pitch-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; background: rgba(14, 12, 10, .35); border: 1px solid rgba(245, 184, 61, .12); }
.clb-pitch-e { flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; background: rgba(245, 184, 61, .14); }
.clb-pitch-item b { font-size: 14.5px; }
@media (max-width: 479px) { .clb-pitch-cta .btn { flex: 1; } }

/* ---------- Formulario de club ---------- */
.clb-form { gap: 18px; }
.clb-preview {
  --c: var(--amber);
  display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; min-width: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--surface)), var(--surface) 75%);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.clb-preview-name { font: 800 19px/1.2 var(--font-display); }
.clb-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.clb-fieldset > legend { padding: 0; margin-bottom: 10px; }

.c-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.c-opt { position: relative; display: block; }
.c-opt input, .c-swatch input, .clb-vis-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.c-opt span {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; font-size: 24px; line-height: 1;
  background: var(--surface); border: 1.5px solid var(--line-soft);
  transition: transform .2s var(--ease-spring), border-color .2s, background .2s, box-shadow .2s;
}
.c-opt:hover span { border-color: var(--line); transform: translateY(-1px); }
.c-opt input:checked + span { border-color: var(--amber); background: rgba(245, 184, 61, .13); box-shadow: 0 0 0 3px rgba(245, 184, 61, .14); transform: scale(1.04); }
.c-opt input:focus-visible + span, .c-swatch input:focus-visible + span, .clb-vis-opt input:focus-visible + .clb-vis-card { outline: 2px solid var(--amber); outline-offset: 2px; }

.c-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.c-swatch { position: relative; display: block; }
.c-swatch span {
  position: relative; display: block; width: 38px; height: 38px; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18);
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.c-swatch:hover span { transform: scale(1.08); }
.c-swatch input:checked + span { box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px var(--c); }
.c-swatch input:checked + span::after {
  content: ''; position: absolute; left: 50%; top: 45%; width: 8px; height: 14px;
  border: solid rgba(0, 0, 0, .6); border-width: 0 3px 3px 0; translate: -50% -50%; rotate: 45deg;
}

.clb-vis { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .clb-vis { grid-template-columns: 1fr 1fr; } }
.clb-vis-opt { position: relative; display: block; }
.clb-vis-card {
  display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 14px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--line-soft);
  transition: border-color .2s, background .2s;
}
.clb-vis-opt:hover .clb-vis-card { border-color: var(--line); }
.clb-vis-opt input:checked + .clb-vis-card { border-color: var(--amber); background: rgba(245, 184, 61, .08); }
.clb-vis-ico { font-size: 22px; margin-bottom: 2px; }

.clb-code-input {
  height: 60px; text-align: center; text-transform: uppercase;
  font: 800 26px/1 var(--font-display); letter-spacing: .32em; font-variant-numeric: tabular-nums;
  padding: 0 0 0 .32em;
}
.clb-code-input::placeholder { letter-spacing: .32em; color: var(--surface-3); font-weight: 800; }

/* ---------- Ficha de club ---------- */
.clb-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-weight: 800; font-size: 13.5px; color: var(--text-3); }
.clb-back svg { width: 18px; height: 18px; }
.clb-back:hover { color: var(--text); }

.clb-hero {
  --c: var(--amber);
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); padding: 22px;
  background:
    radial-gradient(560px 280px at 100% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 65%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 15%, #1b1712) 0%, #16130f 72%);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  box-shadow: var(--shadow);
}
.clb-hero::after {
  content: ''; position: absolute; z-index: -1; right: -70px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.clb-hero-top { display: flex; gap: 16px; align-items: center; min-width: 0; }
.clb-hero-emoji { background: color-mix(in srgb, var(--c) 34%, var(--surface-2)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent), 0 14px 34px -14px color-mix(in srgb, var(--c) 80%, transparent); }
.clb-hero-tags { gap: 6px; }
.clb-hero-name { font-size: clamp(26px, 6.2vw, 42px); margin: 8px 0 6px; overflow-wrap: anywhere; }
.clb-hero-meta { display: flex; flex-wrap: wrap; row-gap: 2px; }
.clb-hero-meta > span + span::before { content: '·'; margin: 0 8px; color: var(--text-3); }
.clb-hero-desc { margin-top: 14px; color: var(--text-2); max-width: 62ch; overflow-wrap: anywhere; }
.clb-hero-actions { margin-top: 18px; gap: 8px; }
@media (max-width: 479px) {
  .clb-hero { padding: 18px; }
  .clb-hero-top { align-items: flex-start; gap: 14px; }
  .clb-hero-actions > .btn.primary { width: 100%; }
}

.clb-invite { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 18px; }
.clb-invite-text { flex: 1 1 220px; min-width: 0; }
.clb-invite-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clb-code {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 13px;
  background: var(--bg-2); border: 1.5px dashed color-mix(in srgb, var(--amber) 45%, var(--line));
  color: var(--amber); font: 800 21px/1 var(--font-display); letter-spacing: .16em; font-variant-numeric: tabular-nums;
  transition: background .2s, border-color .2s, transform .15s var(--ease);
}
.clb-code svg { width: 16px; height: 16px; color: var(--text-3); }
.clb-code:hover { background: var(--surface); border-color: var(--amber); }
.clb-code:active { transform: scale(.97); }
@media (max-width: 559px) {
  .clb-invite-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .clb-invite-actions [data-share] { grid-column: 1 / -1; order: 3; }
}

.clb-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.clb-totals > .skel { margin-bottom: 0 !important; }
.clb-totals .stat-card { padding: 12px; min-width: 0; }
.clb-totals .stat-label { font-size: 10.5px; line-height: 1.3; }
.clb-totals .stat-value { font-size: clamp(20px, 5.6vw, 28px); margin-top: 4px; }
.clb-totals .stat-hint { display: flex; flex-direction: column; margin-top: 4px; font-size: 11.5px; }
@media (min-width: 700px) {
  .clb-totals { gap: 14px; }
  .clb-totals .stat-card { padding: 14px 16px; }
  .clb-totals .stat-label { font-size: 12px; }
  .clb-totals .stat-hint { flex-direction: row; flex-wrap: wrap; font-size: 12.5px; }
  .clb-totals .stat-hint > span + span::before { content: '·'; margin: 0 6px; }
}

.clb-card-pad { padding: 16px 16px 12px; }
.clb-rank-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.clb-rank-list { border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; background: var(--bg-2); }
.clb-rank-list .rank-row .rank-pos { color: var(--text-3); }
.clb-rank-list a.rank-row:hover { background: var(--surface-2); color: var(--text); }
.clb-rank-list .rank-row.me .rank-pos { color: var(--amber); }
.clb-rank-who { min-width: 0; }
.clb-rank-who .title { font-weight: 800; font-size: 14.5px; }
.clb-rank-who .meta { font-size: 12.5px; color: var(--text-3); }
.clb-rank-gap { text-align: center; color: var(--text-3); padding: 2px; letter-spacing: .3em; border-bottom: 1px solid var(--line-soft); }
a.podium-step:hover { color: var(--text); }
a.podium-step:hover .avatar { transform: translateY(-2px); }
.podium-step .avatar { transition: transform .25s var(--ease-spring); }
.clb-podium-free { opacity: .45; }
.clb-podium-free .val { color: var(--text-3) !important; }

.clb-chart { position: relative; height: 200px; }
.clb-map-box { position: relative; height: 280px; border-top: 1px solid var(--line-soft); }
.clb-map-box .map { border-radius: 0; min-height: 0; }
.clb-map-box.is-empty { height: auto; }
.clb-more { border-radius: 0; border-top: 1px solid var(--line-soft); height: 46px; }

/* Club privado */
.clb-locked { max-width: 480px; margin: 12px auto 0; padding: 32px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.clb-locked-ico { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; font-size: 38px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.clb-locked p { max-width: 36ch; }
.clb-locked-form { display: flex; gap: 8px; width: 100%; margin-top: 6px; }
.clb-locked-form .input { flex: 1; min-width: 0; }
.clb-locked-form .btn { height: 60px; }
@media (max-width: 400px) {
  .clb-locked-form { flex-direction: column; }
  .clb-locked-form .btn { height: 50px; }
}

/* ==========================================================================
   Ajustes
   ========================================================================== */
.stg-layout { display: grid; gap: 16px; }
.stg-nav {
  position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 5;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: -6px calc(-1 * var(--gutter)) 0; padding: 8px var(--gutter);
  background: rgba(14, 12, 10, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.stg-nav::-webkit-scrollbar { display: none; }
.stg-nav-link {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.stg-nav-link svg { width: 16px; height: 16px; flex: none; }
.stg-nav-link:hover { color: var(--text); border-color: var(--text-3); }
.stg-nav-link.active { background: var(--amber); color: var(--amber-ink); border-color: transparent; }
@media (min-width: 900px) {
  .stg-nav { top: 0; margin: 0; padding: 8px 0; }
}
@media (min-width: 1000px) {
  .stg-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
  .stg-nav { top: 24px; flex-direction: column; gap: 2px; padding: 0; overflow: visible; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .stg-nav-link { height: 42px; border-radius: 12px; border: 0; background: transparent; justify-content: flex-start; font-size: 14px; }
  .stg-nav-link svg { width: 18px; height: 18px; }
  .stg-nav-link:hover { background: var(--surface); }
  .stg-nav-link.active { background: rgba(245, 184, 61, .12); color: var(--amber); }
}

.stg-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 780px; }
.stg-sec { scroll-margin-top: calc(var(--top-h) + 70px); }
@media (min-width: 900px) { .stg-sec { scroll-margin-top: 70px; } }
@media (min-width: 1000px) { .stg-sec { scroll-margin-top: 24px; } }
@media (min-width: 700px) { .stg-sec { padding: 22px 24px; } }
.stg-sec-head { margin-bottom: 16px; }
.stg-sec-head h2 { font-size: 19px; }
.stg-sec-head p { margin-top: 4px; max-width: 64ch; }

.stg-preview { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line-soft); min-width: 0; }
.stg-preview .avatar { transition: background .3s, box-shadow .3s; }
.stg-preview-name { font: 800 20px/1.2 var(--font-display); }
.stg-preview-bio { margin-top: 6px; overflow-wrap: anywhere; }
@media (max-width: 419px) {
  .stg-preview { padding: 14px; gap: 12px; align-items: flex-start; }
  .stg-preview .avatar.xl { width: 68px; height: 68px; border-radius: 22px; font-size: 34px; }
}

.stg-fields-2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .stg-fields-2 { grid-template-columns: 1fr 1fr; } }
.stg-actions { display: flex; justify-content: flex-end; }
@media (max-width: 639px) { .stg-actions .btn { width: 100%; } }
.stg-row-title { font-weight: 800; font-size: 14.5px; margin-bottom: 2px; color: var(--text); }

.stg-care { background: linear-gradient(160deg, rgba(63, 208, 192, .08), var(--surface) 60%); border-color: rgba(63, 208, 192, .2); }
.stg-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.stg-tips li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.stg-tips li > span:first-child { font-size: 20px; line-height: 1.15; flex: none; }
.stg-tips b { color: var(--text); }
.stg-112 { height: 50px; font-size: 15.5px; }

.stg-danger { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid rgba(255, 90, 90, .28); background: rgba(255, 90, 90, .06); }
.stg-danger .grow { flex: 1 1 240px; }
.stg-danger .stg-row-title { color: var(--red); }
.stg-danger .btn { flex: none; }
@media (max-width: 559px) { .stg-danger .btn { width: 100%; } }

.stg-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 4px; text-align: center; }
.stg-foot-brand { display: flex; align-items: center; gap: 10px; font: 800 16px var(--font-display); }
.stg-foot-brand b { color: var(--amber); font-weight: 800; }
.stg-foot-brand .muted { font: 700 12.5px var(--font); }
.stg-foot-brand .brand-logo { width: 30px; height: 30px; border-radius: 10px; font-size: 16px; }
.stg-foot p { max-width: 46ch; }
