/* FuturLeague — crear competición (sobre home.css) */
@property --h { syntax: '<color>'; inherits: true; initial-value: #4f7bff; }
body.cr-page { --h: #4f7bff; transition: --h .6s ease; }

/* ---------- hero ---------- */
.cr-hero { min-height: 0; padding: 116px 0 40px; }
.cr-hero .hx-title { font-size: clamp(46px, 7vw, 96px); margin-bottom: 18px; }
.cr-hero .hx-lead { max-width: 600px; }
/* formas geométricas flotando */
.cr-shapes { position: absolute; inset: 0; overflow: hidden; }
.sh { position: absolute; display: block; opacity: 0; animation: shIn 1.2s var(--ease) forwards, float 12s ease-in-out infinite; }
.s1 { width: 120px; height: 120px; right: 12%; top: 22%; border: 2px solid rgba(198, 244, 50, .55); border-radius: 50%; animation-delay: .4s, 1.2s; }
.s1::after { content: ""; position: absolute; inset: 22px; border: 2px dashed rgba(198, 244, 50, .35); border-radius: 50%; animation: spin 18s linear infinite; }
.s2 { width: 54px; height: 54px; right: 30%; top: 58%; background: linear-gradient(135deg, #ff6b3d, #ff3d8b); border-radius: 12px; transform: rotate(18deg); animation-delay: .6s, 2s; box-shadow: 0 20px 50px -14px #ff3d8b; }
.s3 { width: 190px; height: 90px; right: 6%; top: 60%; animation-delay: .8s, 1.6s;
  background: linear-gradient(#57d8ff, #57d8ff) 0 0 / 60px 2px no-repeat, linear-gradient(#57d8ff, #57d8ff) 0 100% / 60px 2px no-repeat,
    linear-gradient(#57d8ff, #57d8ff) 60px 0 / 2px 100% no-repeat, linear-gradient(#57d8ff, #57d8ff) 60px 50% / 70px 2px no-repeat; opacity: .7; }
.s3::after { content: ""; position: absolute; left: 124px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: #57d8ff; box-shadow: 0 0 20px #57d8ff; animation: pulse 2.4s ease-in-out infinite; }
.s4 { width: 0; height: 0; right: 42%; top: 16%; border-left: 26px solid transparent; border-right: 26px solid transparent; border-bottom: 44px solid rgba(162, 107, 255, .8); animation-delay: 1s, 2.6s; filter: drop-shadow(0 10px 24px rgba(162, 107, 255, .6)); }
.s5 { width: 14px; height: 14px; right: 22%; top: 12%; border-radius: 50%; background: #f5b301; box-shadow: 0 0 24px #f5b301; animation-delay: 1.2s, 1s; }
@keyframes shIn { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: -10px -16px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.3); } }
@media (max-width: 860px) { .cr-shapes { opacity: .35; } .s3, .s4 { display: none; } }

/* ---------- rejilla del formulario ---------- */
.cr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 8px; }
.cr-steps { position: relative; padding-left: 56px; }
.cr-rail { position: absolute; left: 19px; top: 30px; bottom: 30px; width: 2px; background: var(--line); border-radius: 2px; }
.cr-rail b { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: linear-gradient(var(--accent), #7dffb0); transform-origin: top; transform: scaleY(var(--prog, 0)); transition: transform .8s var(--ease); box-shadow: 0 0 14px rgba(198, 244, 50, .6); border-radius: 2px; }
body.cr-page .card { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02)); border: 1px solid var(--line); border-radius: 24px; box-shadow: none; padding: 26px; }
body.cr-page .card + .card { margin-top: 20px; }
.cr-step { opacity: 0; transform: translateY(24px); animation: fadeup .8s var(--ease) forwards; animation-delay: calc(300ms + var(--i, 0) * 110ms); transition: border-color .5s; }
.cr-step[data-step="1"] { --i: 0; } .cr-step[data-step="2"] { --i: 1; } .cr-step[data-step="3"] { --i: 2; } .cr-step[data-step="4"] { --i: 3; }
.cr-step.done { border-color: rgba(198, 244, 50, .28); }
body.cr-page .step-title { margin-bottom: 18px; }
body.cr-page .step-title h2 { font-size: 30px; text-transform: uppercase; color: #fff; }
body.cr-page .step-title b { position: absolute; left: -56px; top: 22px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #0b1130; color: var(--muted); border: 2px solid var(--line); font: 800 18px var(--display); transition: background .4s, border-color .4s, color .4s, box-shadow .4s; }
body.cr-page .step-title b svg { width: 18px; height: 18px; position: absolute; opacity: 0; transform: scale(.4) rotate(-30deg); transition: opacity .3s, transform .5s var(--ease); }
body.cr-page .step-title b span { transition: opacity .2s, transform .4s var(--ease); }
.cr-step.active .step-title b { border-color: var(--h); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--h) 18%, transparent); }
.cr-step.done .step-title b { background: var(--accent); border-color: var(--accent); color: #0b1433; box-shadow: 0 0 18px rgba(198, 244, 50, .5); }
.cr-step.done .step-title b span { opacity: 0; transform: scale(.4); }
.cr-step.done .step-title b svg { opacity: 1; transform: none; }

/* controles en oscuro */
body.cr-page .field > span, body.cr-page .check span { color: #e3e8fb; }
body.cr-page input[type=text], body.cr-page input[type=number], body.cr-page select, body.cr-page textarea { background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .12); color: #fff; border-radius: 12px; transition: border-color .25s, box-shadow .25s, background .25s; }
body.cr-page input::placeholder, body.cr-page textarea::placeholder { color: #6e7aa3; }
body.cr-page input:focus, body.cr-page select:focus, body.cr-page textarea:focus { border-color: var(--h); background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 4px color-mix(in srgb, var(--h) 22%, transparent); }
body.cr-page select option { background: #10172b; color: #fff; }
body.cr-page .check input { accent-color: var(--accent); }
body.cr-page .tb-list { border-color: var(--line); border-radius: 14px; }
body.cr-page .tb-list li { background: rgba(255, 255, 255, .03); border-color: var(--line); }
body.cr-page .tb-list button { background: rgba(255, 255, 255, .07); color: #fff; }
body.cr-page .tb-list button:hover:not(:disabled) { background: var(--h); color: #0b1433; }
body.cr-page .seg { background: rgba(255, 255, 255, .06); }
body.cr-page .seg input:checked + span { background: var(--accent); color: #0b1433; box-shadow: none; }
body.cr-page .seg span { color: var(--ink-2); }

/* tarjetas de formato */
body.cr-page .type-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
body.cr-page .type-pick .opt-card { position: relative; border: 1px solid var(--line); border-radius: 18px; padding: 0 0 14px; overflow: hidden; background: rgba(255, 255, 255, .025);
  transition: border-color .35s, background .35s, transform .45s var(--ease), box-shadow .45s var(--ease); }
body.cr-page .type-pick label:hover .opt-card { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
body.cr-page .type-pick .opt-card > svg { display: none; } /* la mini animación ya identifica el formato */
.oc-viz { height: 86px; color: var(--c); border-bottom: 1px solid var(--line); background: radial-gradient(120% 100% at 50% 120%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); }
body.cr-page .type-pick .oc-viz svg { width: 100%; height: 100%; overflow: visible; color: var(--c); display: block; }
.oc-viz .viz * { animation-play-state: running !important; }
.type-pick input:not(:checked) + .opt-card .oc-viz { opacity: .75; transition: opacity .3s; }
.type-pick label:hover .oc-viz { opacity: 1; }
body.cr-page .type-pick .opt-card strong { margin: 12px 14px 2px; color: #fff; font-size: 15px; }
body.cr-page .type-pick .opt-card small { margin: 0 14px; color: var(--muted); font-size: 12.5px; }
body.cr-page .type-pick input:checked + .opt-card { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: 0 20px 40px -24px var(--c); }
body.cr-page .type-pick .opt-card::after { content: ""; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1433' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat; transform: scale(0); transition: transform .4s var(--ease); }
body.cr-page .type-pick input:checked + .opt-card::after { transform: scale(1); }
body.cr-page .type-pick input:focus-visible + .opt-card { outline: 3px solid var(--c); outline-offset: 2px; }

/* fichas de participantes */
.seeds { display: flex; flex-wrap: wrap; gap: 7px; margin: -4px 0 14px; min-height: 0; }
.seed { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: #e3e8fb; max-width: 200px; }
.seed i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: color-mix(in srgb, var(--h) 30%, transparent); color: #fff; flex: none; }
.seed:nth-child(1) i { background: #f5b301; color: #0b1433; } .seed:nth-child(2) i { background: #c8d0e0; color: #0b1433; } .seed:nth-child(3) i { background: #e29a5a; color: #0b1433; }
.seed span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seed.new { animation: seedIn .5s var(--ease); }
.seed.dup { border-color: rgba(229, 72, 77, .7); background: rgba(229, 72, 77, .14); }
.seed.more { padding: 5px 12px; color: var(--muted); }
@keyframes seedIn { from { opacity: 0; transform: translateY(8px) scale(.7); } }

/* ---------- vista previa ---------- */
.cr-aside { position: sticky; top: 84px; opacity: 0; animation: fadeup .9s var(--ease) .5s forwards; }
body.cr-page .preview { border-color: color-mix(in srgb, var(--h) 45%, var(--line)); box-shadow: 0 40px 90px -50px var(--h); transition: border-color .6s, box-shadow .6s; padding: 20px; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pv-live { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--h); }
.pv-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--h); animation: ping 2s infinite; }
.pv-type { font: 800 20px var(--display); text-transform: uppercase; color: #fff; text-align: right; }
.pv-stage { position: relative; height: 170px; border-radius: 16px; overflow: hidden; margin-bottom: 16px; color: var(--h);
  background: radial-gradient(120% 100% at 50% 120%, color-mix(in srgb, var(--h) 28%, transparent), transparent 70%), #0b1130; border: 1px solid var(--line); }
.pv-stage::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.pv-scene { position: absolute; inset: 10px; display: grid; place-items: center; opacity: 0; transform: scale(.9) rotate(-2deg); transition: opacity .45s var(--ease), transform .6s var(--ease); }
.pv-scene.on { opacity: 1; transform: none; }
.pv-scene svg { width: 100%; height: 100%; overflow: visible; }
.pv-scene.on .viz * { animation-play-state: running !important; }
/* cada pareja dt/dd es una baldosa: se colocan en dos columnas */
body.cr-page .summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; row-gap: 0; margin: 0 0 16px; }
body.cr-page .summary dt { font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); background: rgba(255, 255, 255, .045); border-radius: 14px 14px 0 0; padding: 11px 13px 0; }
body.cr-page .summary dd { margin: 0 0 10px; text-align: left; font: 800 25px/1.1 var(--display); color: #fff; overflow-wrap: anywhere; background: rgba(255, 255, 255, .045); border-radius: 0 0 14px 14px; padding: 3px 13px 11px; }
.summary dl > :nth-child(1) { grid-area: 1 / 1; } .summary dl > :nth-child(2) { grid-area: 2 / 1; }
.summary dl > :nth-child(3) { grid-area: 1 / 2; } .summary dl > :nth-child(4) { grid-area: 2 / 2; }
.summary dl > :nth-child(5) { grid-area: 3 / 1; } .summary dl > :nth-child(6) { grid-area: 4 / 1; }
.summary dl > :nth-child(7) { grid-area: 3 / 2; } .summary dl > :nth-child(8) { grid-area: 4 / 2; }
.summary dl > :nth-child(9) { grid-area: 5 / 1; } .summary dl > :nth-child(10) { grid-area: 6 / 1; }
.summary dl > :nth-child(11) { grid-area: 5 / 2; } .summary dl > :nth-child(12) { grid-area: 6 / 2; }
body.cr-page .summary dd.bump { animation: bump .55s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); color: var(--accent); } }
body.cr-page .errors { background: rgba(229, 72, 77, .12); color: #ffb3b6; border: 1px solid rgba(229, 72, 77, .4); border-radius: 12px; }
.cr-submit { width: 100%; position: relative; overflow: hidden; }
.cr-submit::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); animation: shine 3.6s ease-in-out 2s infinite; }
@keyframes shine { 0% { left: -60%; } 35%, 100% { left: 130%; } }
.cr-submit[disabled]::before { display: none; }
.cr-submit.ready { box-shadow: 0 0 0 0 rgba(198, 244, 50, .6), 0 10px 40px -8px rgba(198, 244, 50, .55); animation: ready 2.2s ease-out infinite; }
@keyframes ready { 70% { box-shadow: 0 0 0 12px rgba(198, 244, 50, 0), 0 10px 40px -8px rgba(198, 244, 50, .55); } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .cr-grid { grid-template-columns: minmax(0, 1fr); }
  .cr-aside { position: static; }
  body.cr-page .type-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cr-steps { padding-left: 0; }
  body.cr-page .row { grid-template-columns: 1fr; gap: 0; }
  .cr-rail { display: none; }
  body.cr-page .step-title b { position: static; width: 34px; height: 34px; font-size: 16px; }
  body.cr-page .card { padding: 20px; }
  body.cr-page .type-pick { grid-template-columns: 1fr 1fr; gap: 10px; }
  .oc-viz { height: 70px; }
  body.cr-page .step-title h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .sh, .cr-step, .cr-aside { animation: none !important; opacity: 1; transform: none; }
  .cr-submit::before, .cr-submit.ready { animation: none !important; }
  .oc-viz .viz *, .pv-scene .viz * { animation: none !important; }
}
