/* ==========================================================================
   TEAM STUDIO — Kit Studio, Pizarra Táctica y Mi Club
   (reutiliza las variables y la base de .bk-root de booking.css)
   ========================================================================== */
.ts-root { overflow: hidden; }
.ts-root .bk-head { position: relative; z-index: 3; }
.ts-root button { -webkit-tap-highlight-color: transparent; }
.ts-root ::-webkit-scrollbar { width: 0; height: 0; }

/* ---- hojas modales ---- */
.ts-sheet .bk-sheet-card { display: flex; flex-direction: column; max-height: 88%; }
.ts-sheet .bk-sheet-card.is-wide { max-height: 92%; }
.ts-sheet-body { overflow-y: auto; padding: 2px 2px 8px; flex: 1; min-height: 0; }
.ts-sheet-actions { display: flex; gap: 10px; padding-top: 10px; }
.ts-sheet-actions .bk-cta, .ts-sheet-actions .bk-ghost { flex: 1; }
.ts-confirm { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 6px 4px 8px; }
.ts-confirm p { font-size: 14px; line-height: 1.5; color: var(--bk-muted); }
.ts-confirm-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(50, 199, 54, 0.14); color: var(--bk-accent); }
.ts-confirm-ico.is-danger { background: rgba(239, 68, 68, 0.14); color: #EF4444; }
.bk-cta.is-danger { background: linear-gradient(135deg, #F87171, #DC2626); color: #fff; box-shadow: 0 10px 24px rgba(239, 68, 68, 0.35); }

/* ---- interruptores ---- */
.ks-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.ks-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ks-switch > span { position: relative; width: 38px; height: 22px; border-radius: 22px; background: var(--bk-line); transition: background 0.25s; flex-shrink: 0; }
.ks-switch > span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.ks-switch input:checked + span { background: var(--bk-accent); }
.ks-switch input:checked + span::after { transform: translateX(16px); }
.ks-switch input:focus-visible + span { outline: 2px solid var(--bk-accent); outline-offset: 2px; }

/* ==========================================================================
   KIT STUDIO
   ========================================================================== */
.ks-root.is-closing { pointer-events: none; }
/* The dialog fills the frame; background content must not scroll that frame
   sideways when a control receives focus in a narrow landscape layout. */
.app-frame:has(> .ks-root.is-open) { overflow: clip; }
.ks-stage {
  position: relative;
  flex: 0 0 min(42%, 390px);
  min-height: 270px;
  overflow: hidden;
  border-bottom: 1px solid var(--bk-line);
  background:
    radial-gradient(ellipse at 50% 110%, rgba(50, 199, 54, 0.19), transparent 60%),
    radial-gradient(ellipse at 80% 18%, rgba(91, 175, 222, 0.1), transparent 48%),
    linear-gradient(160deg, #152129, #080e13 66%, #0b1611);
}
[data-theme="light"] .ks-stage { background: radial-gradient(ellipse at 50% 100%, rgba(50, 199, 54, 0.14), transparent 62%), linear-gradient(160deg, #f0f5f4, #d9e3e7 70%, #e9f1ed); }
.ks-stage::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 79px, rgba(163, 200, 210, 0.045) 79px 80px), linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 70%); }
.ks-model-host { position: absolute; inset: 35px 0 32px; z-index: 2; opacity: 0; pointer-events: none; }
.ks-model-host canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: pan-y; cursor: grab; }
.ks-model-host canvas:active { cursor: grabbing; }
.ks-model-host canvas:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: -4px; border-radius: 14px; }
.ks-stage[data-renderer="webgl"] .ks-model-host { opacity: 1; pointer-events: auto; }
.ks-stage[data-renderer="webgl"] .ks-viewer, .ks-stage[data-renderer="webgl"] .ks-floor, .ks-stage[data-renderer="webgl"] .ks-rings { display: none; pointer-events: none; }
.ks-stage:not([data-renderer="webgl"]) .ks-viewer, .ks-stage:not([data-renderer="webgl"]) .ks-floor, .ks-stage:not([data-renderer="webgl"]) .ks-rings { display: block; visibility: visible; }
.ks-stage[data-renderer="webgl"] .ks-rings::before, .ks-stage[data-renderer="webgl"] .ks-rings::after, .ks-stage[data-renderer="webgl"] .ks-flip { animation: none; }
.ks-drag-hint { display: none; position: absolute; bottom: 48px; left: 14px; z-index: 3; max-width: 90px; color: var(--bk-muted); font-size: 9px; font-weight: 700; line-height: 1.5; letter-spacing: 0.02em; pointer-events: none; }
.ks-drag-hint i { display: block; margin-bottom: 3px; color: var(--bk-accent); font-size: 12px; }
.ks-stage[data-renderer="webgl"] .ks-drag-hint { display: block; }
.ks-glow { position: absolute; left: 50%; top: -20%; width: 70%; height: 90%; transform: translateX(-50%); background: conic-gradient(from 180deg at 50% 0%, transparent 38%, rgba(255, 255, 255, 0.10) 47%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0.10) 53%, transparent 62%); filter: blur(6px); pointer-events: none; }
.ks-rings { position: absolute; left: 50%; bottom: 40px; width: 270px; height: 70px; transform: translateX(-50%); }
.ks-rings::before, .ks-rings::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--bk-accent); opacity: 0.5; animation: ksRing 3.2s ease-out infinite; }
.ks-rings::after { animation-delay: 1.6s; }
@keyframes ksRing { from { transform: scale(0.45); opacity: 0.7; } to { transform: scale(1.25); opacity: 0; } }
.ks-floor { position: absolute; left: 50%; bottom: 44px; width: 210px; height: 50px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02) 60%, transparent 72%), linear-gradient(180deg, #17261c, #0b140e); border: 1.5px solid var(--bk-accent); box-shadow: 0 0 28px var(--bk-glow), inset 0 4px 12px rgba(255, 255, 255, 0.08); }
[data-theme="light"] .ks-floor { background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.3) 60%, transparent 72%), linear-gradient(180deg, #e3efe7, #bcd3c3); }
.ks-viewer {
  position: absolute;
  left: 50%;
  bottom: 64px;
  height: calc(100% - 84px);
  aspect-ratio: 200 / 380;
  transform: translateX(-50%);
  perspective: 1100px;
  pointer-events: none;
  -webkit-box-reflect: below 6px linear-gradient(transparent 72%, rgba(255, 255, 255, 0.18));
}
.ks-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.85s cubic-bezier(0.2, 0.85, 0.25, 1); }
.ks-viewer.v-back .ks-flip { transform: rotateY(180deg); }
.ks-viewer.v-spin .ks-flip { animation: ksSpin 7s linear infinite; }
@keyframes ksSpin { to { transform: rotateY(360deg); } }
.ks-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ks-back { transform: rotateY(180deg); }
.ks-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35)); }
.ks-stage:not([data-focus="full"]) .ks-viewer { bottom: 48px; height: calc(100% - 98px); width: calc(100% - 48px); aspect-ratio: auto; -webkit-box-reflect: none; }
.ks-stage:not([data-focus="full"]) .ks-floor, .ks-stage:not([data-focus="full"]) .ks-rings { display: none; }
.ks-stage[data-focus="logo"] .ks-crestchip, .ks-stage[data-focus="logo"] .ks-playersel { display: none; }
.ks-stage[data-focus="logo"] .ks-logo-svg { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.22)); }

.ks-hud { position: absolute; left: 0; right: 0; display: flex; justify-content: center; z-index: 4; pointer-events: none; }
.ks-hud-top { top: 10px; }
.ks-hud-bottom { bottom: 8px; }
.ks-seg { pointer-events: auto; display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--bk-line); backdrop-filter: blur(8px); transform: skewX(-6deg); }
[data-theme="light"] .ks-seg { background: rgba(255, 255, 255, 0.78); }
.ks-seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; color: var(--bk-muted); transition: all 0.2s; }
.ks-seg button i { margin-right: 4px; }
.ks-seg button.is-on { background: var(--bk-accent); color: var(--bk-ink); box-shadow: 0 4px 12px var(--bk-glow); }
.ks-crestchip { position: absolute; left: 12px; top: 54px; z-index: 4; padding: 6px; border-radius: 14px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--bk-line); backdrop-filter: blur(6px); line-height: 0; }
[data-theme="light"] .ks-crestchip { background: rgba(255, 255, 255, 0.7); }
.ks-playersel { position: absolute; right: 12px; top: 54px; z-index: 4; display: grid; gap: 3px; max-width: 124px; }
.ks-playersel span { font-size: 9px; font-weight: 800; letter-spacing: 0.18em; color: var(--bk-muted); text-transform: uppercase; }
.ks-playersel select { width: 100%; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--bk-line); background: rgba(0, 0, 0, 0.5); color: var(--bk-text); font-size: 11.5px; font-weight: 700; font-family: inherit; backdrop-filter: blur(6px); }
[data-theme="light"] .ks-playersel select { background: rgba(255, 255, 255, 0.85); }

.ks-motionbar { display: flex; align-items: center; gap: 10px; padding: 5px 10px; flex-shrink: 0; border-bottom: 1px solid var(--bk-line); background: var(--bk-bg2); }
.ks-motionbar[hidden] { display: none; }
.ks-motion-status { font-size: 9px; font-weight: 700; color: var(--bk-muted); }
.ks-motionbar > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-left: auto; flex: 1; max-width: 270px; }
.ks-motionbar button { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 34px; padding: 5px 6px; border: 1px solid var(--bk-line); border-radius: 8px; background: transparent; color: var(--bk-muted); font-family: var(--font-display); font-size: 10px; font-weight: 800; }
.ks-motionbar button i { font-size: 12px; }
.ks-motionbar button.is-on { border-color: var(--bk-accent); background: rgba(50, 199, 54, 0.14); color: var(--bk-accent); }
.ks-motionbar button:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: -2px; }
.ks-motionbar[data-editing="true"] .ks-motion-status { color: var(--bk-accent); }
.ks-parts { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 6px 7px; flex-shrink: 0; border-bottom: 1px solid var(--bk-line); background: var(--bk-bg2); }
.ks-parts button { min-width: 0; min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 5px 1px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--bk-muted); font-family: var(--font-display); font-weight: 800; font-size: 10px; line-height: 1.1; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.ks-parts button i { font-size: 14px; }
.ks-parts button span { width: 100%; text-align: center; font-size: clamp(8px, 2.2vw, 10px); }
.ks-parts button[data-k="shorts"] span { font-size: clamp(8px, 2vw, 10px); letter-spacing: -0.04em; }
.ks-parts button.is-on { background: rgba(50, 199, 54, 0.14); border-color: var(--bk-accent); color: var(--bk-accent); box-shadow: inset 0 -2px 0 var(--bk-accent); }
.ks-parts button:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: -2px; }
.ks-back-detail { display: grid; gap: 5px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--bk-line); border-radius: 12px; background: var(--bk-card); }
.ks-back-detail>span { color: var(--bk-muted); font-size: 11px; }
.ks-back-detail strong { font-family: var(--font-display); font-size: 20px; }
.ks-back-detail b { margin-left: 8px; color: var(--bk-accent); }
.ks-tabs { display: grid; grid-template-columns: repeat(5, 1fr); flex-shrink: 0; border-bottom: 1px solid var(--bk-line); background: var(--bk-card); }
.ks-tabs button { position: relative; border: 0; background: transparent; padding: 9px 2px 8px; display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 800; color: var(--bk-muted); transition: color 0.2s; }
.ks-tabs button i { font-size: 15px; }
.ks-tabs button::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--bk-accent); transform: scaleX(0); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.ks-tabs button.is-on { color: var(--bk-accent); }
.ks-tabs button.is-on::after { transform: scaleX(1); }

.ks-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 14px; }
.ks-panel.is-in { animation: bkRise 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.ks-hint { font-size: 12px; color: var(--bk-muted); margin-bottom: 10px; }
.ks-h { margin: 14px 0 8px; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bk-accent); padding-left: 9px; border-left: 3px solid var(--bk-accent); }
.ks-h:first-child { margin-top: 0; }
.ks-grid { display: grid; gap: 8px; }
.ks-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ks-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ks-tpl, .ks-pat { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 8px 4px 6px; border-radius: 14px; border: 1.5px solid var(--bk-line); background: var(--bk-card); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, box-shadow 0.2s; }
.ks-tpl:hover, .ks-pat:hover { transform: translateY(-2px); border-color: var(--bk-accent); }
.ks-tpl:active, .ks-pat:active { transform: scale(0.96); }
.ks-tpl.is-sel, .ks-pat.is-sel { border-color: var(--bk-accent); box-shadow: 0 0 0 1px var(--bk-accent), 0 6px 16px var(--bk-glow); background: rgba(50, 199, 54, 0.08); }
.ks-tpl svg { width: 56px; height: auto; }
.ks-pat svg { width: 100%; max-width: 70px; height: auto; }
.ks-tpl span, .ks-pat span { font-size: 10px; font-weight: 800; text-align: center; line-height: 1.15; color: var(--bk-text); }
.ks-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ks-chips button { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 12.5px; font-weight: 700; transition: all 0.2s; }
.ks-chips button.is-on { background: var(--bk-accent); border-color: var(--bk-accent); color: var(--bk-ink); box-shadow: 0 4px 12px var(--bk-glow); }

.ks-slots { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 0 -14px 4px; padding-left: 14px; padding-right: 14px; }
.ks-slots button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 8px; border-radius: 999px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 12px; font-weight: 700; white-space: nowrap; transition: all 0.2s; }
.ks-slots button i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--bk-line); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.ks-slots button.is-on { border-color: var(--bk-accent); box-shadow: 0 0 0 1px var(--bk-accent); }
.ks-slotname { margin: 4px 2px 10px; font-weight: 800; font-size: 13px; }
.ks-slotname code { margin-left: 6px; font-size: 11px; color: var(--bk-muted); background: var(--bk-card); padding: 2px 6px; border-radius: 6px; }
.ks-pal { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.ks-sw { position: relative; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--bk-line); background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1); cursor: pointer; padding: 0; }
.ks-sw:hover { transform: scale(1.12); }
.ks-sw.is-on { border-color: var(--bk-accent); transform: scale(1.14); box-shadow: 0 0 0 2px var(--bk-accent), inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.ks-sw-custom { display: grid; place-items: center; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); color: #fff; font-size: 13px; overflow: hidden; }
.ks-sw-custom i { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.ks-sw-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.ks-crest-hero { display: grid; place-items: center; padding: 8px 0 12px; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.35)); }
.ks-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 8px; margin: 0 -14px; }
.ks-cp { flex: 0 0 auto; display: grid; place-items: center; padding: 6px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: var(--bk-card); line-height: 0; transition: all 0.2s; min-width: 52px; min-height: 52px; }
.ks-cp:hover { border-color: var(--bk-accent); transform: translateY(-2px); }
.ks-cp.is-sel { border-color: var(--bk-accent); box-shadow: 0 0 0 1px var(--bk-accent), 0 4px 12px var(--bk-glow); }
.ks-none { font-size: 18px; color: var(--bk-muted); line-height: 1; }
.ks-initials { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ks-initials input[data-f="initials"] { width: 92px; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: var(--bk-card); color: var(--bk-text); font-family: var(--font-display); font-weight: 900; font-size: 18px; letter-spacing: 0.12em; text-align: center; outline: none; text-transform: uppercase; }
.ks-initials input[data-f="initials"]:focus { border-color: var(--bk-accent); box-shadow: 0 0 0 3px var(--bk-glow); }

.ks-extra { display: grid; gap: 10px; }
.ks-switch-row { padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--bk-line); background: var(--bk-card); }
.ks-switch-row b { flex: 1; font-size: 13.5px; }
.ks-switch-row small { font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; color: var(--bk-muted); }
.ks-action { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--bk-line); background: var(--bk-card); transition: all 0.2s; }
.ks-action:hover { border-color: var(--bk-accent); transform: translateY(-1px); }
.ks-action > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(50, 199, 54, 0.14); color: var(--bk-accent); font-size: 16px; flex-shrink: 0; }
.ks-action b { display: block; font-size: 13.5px; }
.ks-action small { display: block; font-size: 11.5px; color: var(--bk-muted); margin-top: 1px; }

.ks-foot { display: flex; gap: 10px; align-items: center; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); flex-shrink: 0; border-top: 1px solid var(--bk-line); background: color-mix(in srgb, var(--bk-bg2) 90%, transparent); backdrop-filter: blur(10px); }
.ks-foot .bk-cta { flex: 1; }
.ks-lock { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--bk-muted); }
.ks-lock i { color: var(--bk-gold); font-size: 18px; }

@media (max-height: 700px) {
  .ks-stage { flex-basis: 44%; min-height: 235px; }
  .ks-tabs button span { display: none; }
}
@media (max-height: 500px) and (min-width: 560px) {
  .ks-root.is-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; }
  .ks-root > .bk-head { grid-column: 1 / -1; grid-row: 1; padding: 6px 12px; }
  .ks-root > .ks-stage { grid-column: 1; grid-row: 2 / 6; min-height: 0; }
  .ks-root > .ks-motionbar { grid-column: 2; grid-row: 2; padding: 3px 5px; }
  .ks-root .ks-motion-status { display: none; }
  .ks-root .ks-motionbar > div { max-width: none; }
  .ks-root .ks-motionbar button { min-height: 30px; padding: 4px 2px; gap: 4px; font-size: 9px; }
  .ks-root > .ks-parts { grid-column: 2; grid-row: 3; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px 5px; gap: 1px; }
  .ks-root .ks-parts button { min-height: 34px; gap: 3px; font-size: 9px; }
  .ks-root .ks-parts button i { font-size: 11px; }
  .ks-root .ks-parts button[data-k="shorts"] span { font-size: 8px; }
  .ks-root > .ks-tabs { grid-column: 2; grid-row: 4; }
  .ks-root > .ks-panel { grid-column: 2; grid-row: 5; padding: 8px 10px; }
  .ks-root > .ks-foot { grid-column: 1 / -1; grid-row: 6; padding: 8px 12px; }
  .ks-root .ks-foot .bk-cta, .ks-root .ks-foot .bk-ghost { min-width: 0; padding: 10px 14px; font-size: 12px; }
  .ks-root .ks-seg button { padding: 6px 7px; font-size: 10px; }
  .ks-root .ks-playersel { max-width: 80px; right: 8px; top: 46px; }
  .ks-root .ks-playersel span { display: none; }
  .ks-root .ks-playersel select { padding: 6px 5px; font-size: 10px; }
  .ks-root .ks-crestchip { left: 8px; padding: 3px; }
  .ks-root .ks-stage[data-renderer="webgl"] .ks-drag-hint { display: none; }
}
@media (max-height: 500px) and (max-width: 559px) {
  .ks-root > .ks-stage { flex-basis: 40%; min-height: 140px; }
  .ks-root > .bk-head { padding: 4px 10px; }
  .ks-root > .ks-foot { padding: 6px 10px; }
  .ks-root .ks-foot .bk-cta, .ks-root .ks-foot .bk-ghost { min-width: 0; padding: 8px 12px; font-size: 11px; }
  .ks-root .ks-parts { padding: 3px 5px; }
  .ks-root .ks-parts button { min-height: 35px; gap: 3px; }
  .ks-root .ks-parts button i { font-size: 11px; }
  .ks-root .ks-motionbar { padding: 3px 7px; }
  .ks-root .ks-motionbar button { min-height: 30px; font-size: 9px; }
  .ks-root .ks-playersel { max-width: 90px; right: 8px; top: 46px; }
  .ks-root .ks-playersel span { display: none; }
  .ks-root .ks-playersel select { padding: 6px 5px; font-size: 10px; }
  .ks-root .ks-crestchip, .ks-root .ks-stage[data-renderer="webgl"] .ks-drag-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ks-rings::before, .ks-rings::after, .ks-viewer.v-spin .ks-flip { animation: none; }
}

/* ==========================================================================
   PIZARRA TÁCTICA
   ========================================================================== */
.tb-top { display: flex; align-items: center; gap: 8px; padding: 2px 12px 6px; flex-shrink: 0; }
.tb-size { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bk-card); border: 1px solid var(--bk-line); flex-shrink: 0; transform: skewX(-6deg); }
.tb-size button { border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 900; color: var(--bk-muted); transition: all 0.2s; }
.tb-size button.is-on { background: var(--bk-accent); color: var(--bk-ink); box-shadow: 0 4px 12px var(--bk-glow); }
.tb-forms { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding: 2px 0; }
.tb-forms button { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 12px; font-weight: 800; white-space: nowrap; transition: all 0.2s; }
.tb-forms button.is-on { background: var(--bk-accent); border-color: var(--bk-accent); color: var(--bk-ink); box-shadow: 0 4px 12px var(--bk-glow); }
.tb-forms[data-ro] button:not(.is-on) { opacity: 0.55; }

.tb-pitchwrap { position: relative; flex: 1; min-height: 0; margin: 0 12px; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--bk-line); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); background: #0a2e18; }
.tb-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.tb-svg[data-tool="move"] .tb-tok { cursor: grab; }
.tb-svg[data-tool="pass"], .tb-svg[data-tool="run"] { cursor: crosshair; }
.tb-svg[data-tool="erase"] .tb-arrow { cursor: pointer; }
.tb-tok { transition: filter 0.2s; }
.tb-tok:hover { filter: brightness(1.12); }
.tb-ring { animation: tbRing 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes tbRing { 50% { transform: scale(1.12); opacity: 0.6; } }

.tb-info { min-height: 58px; padding: 8px 14px 4px; flex-shrink: 0; display: flex; align-items: center; }
.tb-hint { font-size: 12px; color: var(--bk-muted); line-height: 1.4; }
.tb-hint i { color: var(--bk-accent); margin-right: 5px; }
.tb-sel { display: flex; align-items: center; gap: 10px; width: 100%; animation: bkRise 0.3s both; }
.tb-sel-face { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; border: 2px solid var(--bk-accent); flex-shrink: 0; line-height: 0; }
.tb-sel-face img, .tb-sel-face svg { width: 100%; height: 100%; object-fit: cover; }
.tb-sel > div { flex: 1; min-width: 0; }
.tb-sel strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-sel small { font-size: 11.5px; color: var(--bk-muted); }
.tb-swap { flex-shrink: 0; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 12px; font-weight: 800; transition: all 0.2s; }
.tb-swap.is-on { background: var(--bk-gold); border-color: var(--bk-gold); color: #231A00; animation: bkBeat 1.4s infinite; }

.tb-bench-wrap { display: flex; align-items: center; gap: 8px; padding: 0 12px; flex-shrink: 0; }
.tb-bench-l { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 9px; font-weight: 900; letter-spacing: 0.24em; color: var(--bk-muted); }
.tb-bench { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding: 4px 2px 8px; min-height: 76px; align-items: center; }
.tb-bp { flex: 0 0 auto; position: relative; display: grid; justify-items: center; gap: 1px; padding: 0; border: 0; background: transparent; width: 54px; }
.tb-bp-face { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 2px solid var(--bk-line); line-height: 0; transition: all 0.2s; }
.tb-bp-face img, .tb-bp-face svg { width: 100%; height: 100%; object-fit: cover; }
.tb-bp.is-ready .tb-bp-face { border-color: var(--bk-accent); box-shadow: 0 0 0 2px var(--bk-glow); animation: bkBeat 1.6s infinite; }
.tb-bp b { position: absolute; top: -2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bk-accent); color: var(--bk-ink); font-size: 10.5px; font-weight: 900; display: grid; place-items: center; }
.tb-bp small { font-size: 10.5px; font-weight: 700; max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tb-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 12px 8px; flex-shrink: 0; }
.tb-toolset { display: inline-flex; gap: 4px; padding: 3px; border-radius: 13px; background: var(--bk-card); border: 1px solid var(--bk-line); }
.tb-toolset button { border: 0; background: transparent; padding: 6px 6px; border-radius: 10px; display: grid; justify-items: center; gap: 2px; font-size: 9.5px; font-weight: 800; color: var(--bk-muted); transition: all 0.2s; min-width: 40px; }
.tb-toolset button i { font-size: 14px; }
.tb-toolset button.is-on { background: var(--bk-accent); color: var(--bk-ink); box-shadow: 0 4px 12px var(--bk-glow); }
.tb-toolset button:disabled, .tb-acts button:disabled { opacity: 0.35; }
.tb-acts { display: inline-flex; gap: 4px; }
.tb-acts button { width: 36px; height: 40px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 15px; transition: all 0.2s; }
.tb-acts button:hover:not(:disabled) { border-color: var(--bk-accent); color: var(--bk-accent); }
.tb-foot { padding: 8px 14px calc(12px + env(safe-area-inset-bottom)); flex-shrink: 0; border-top: 1px solid var(--bk-line); background: color-mix(in srgb, var(--bk-bg2) 90%, transparent); }
.tb-foot .bk-cta { width: 100%; }

.tb-save { display: flex; gap: 8px; margin-bottom: 12px; }
.tb-save input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: var(--bk-card); color: var(--bk-text); font-family: inherit; font-size: 14px; outline: none; }
.tb-save input:focus { border-color: var(--bk-accent); box-shadow: 0 0 0 3px var(--bk-glow); }
.tb-save .bk-cta { min-width: 0; padding: 12px 18px; }
.tb-play { display: flex; gap: 8px; margin-bottom: 8px; }
.tb-play > button:first-child { flex: 1; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--bk-line); background: var(--bk-card); transition: all 0.2s; }
.tb-play > button:first-child:hover { border-color: var(--bk-accent); }
.tb-play i { color: var(--bk-accent); }
.tb-play b { display: block; font-size: 14px; }
.tb-play small { font-size: 11.5px; color: var(--bk-muted); }
.tb-del { width: 46px; border-radius: 14px; border: 1.5px solid rgba(239, 68, 68, 0.4); background: transparent; color: #EF4444; }

@media (max-height: 740px) {
  .tb-bench { min-height: 64px; }
  .tb-bp-face { width: 40px; height: 40px; }
  .tb-info { min-height: 48px; }
}

/* ==========================================================================
   MI CLUB — card del equipo, cards de jugador, edición y capitanía
   ========================================================================== */
.th-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 28px; display: grid; gap: 16px; align-content: start; }
.th-hero { display: grid; justify-items: center; gap: 12px; padding-top: 4px; }
.th-card-wrap { --rx: 0deg; --ry: 0deg; width: min(76%, 290px); transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.18s ease-out; filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.5)); animation: thCardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes thCardIn { from { opacity: 0; transform: perspective(900px) rotateY(-70deg) scale(0.85); } to { opacity: 1; } }
.th-cardsvg { width: 100%; height: auto; display: block; }
.th-sheen { animation: thSheen 4.6s 1s ease-in-out infinite; transform: skewX(-18deg); }
@keyframes thSheen { 0%, 35% { transform: translateX(0) skewX(-18deg); } 75%, 100% { transform: translateX(520px) skewX(-18deg); } }
.th-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.th-hero-actions button { padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 12.5px; font-weight: 800; transition: all 0.2s; }
.th-hero-actions button:hover { border-color: var(--bk-accent); transform: translateY(-1px); }
.th-hero-actions .is-pri { background: var(--bk-accent); border-color: var(--bk-accent); color: var(--bk-ink); box-shadow: 0 6px 16px var(--bk-glow); }
.th-role { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--bk-line); font-size: 11.5px; font-weight: 800; color: var(--bk-muted); }
.th-role.is-cap { color: var(--bk-gold); border-color: var(--bk-gold); background: rgba(244, 201, 93, 0.1); }

.th-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.th-quick button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 16px; border: 1.5px solid var(--bk-line); background: var(--bk-card); transition: all 0.2s; }
.th-quick button:hover { border-color: var(--bk-accent); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25); }
.th-quick i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(50, 199, 54, 0.14); color: var(--bk-accent); font-size: 18px; flex-shrink: 0; }
.th-quick b { display: block; font-size: 14px; }
.th-quick small { font-size: 11px; color: var(--bk-muted); }

.th-block { padding: 14px; border-radius: 18px; border: 1.5px solid var(--bk-line); background: var(--bk-card); }
.th-block .ks-h { margin-top: 0; }
.th-motto { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 18px; margin-bottom: 6px; }
.th-bio { font-size: 13px; line-height: 1.55; color: var(--bk-muted); }
.th-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.th-facts > div { padding: 10px 12px; border-radius: 12px; background: var(--bk-card); border: 1px solid var(--bk-line); }
.th-facts small { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.16em; color: var(--bk-muted); }
.th-facts strong { font-size: 13px; }
.th-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.th-sec-head .ks-h { margin: 0; }
.th-sec-head em { font-style: normal; color: var(--bk-muted); font-size: 11px; margin-left: 6px; }
.th-add { padding: 8px 14px; border-radius: 999px; border: 0; background: var(--bk-accent); color: var(--bk-ink); font-size: 12px; font-weight: 800; box-shadow: 0 4px 12px var(--bk-glow); }
.th-squad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.th-addtile { aspect-ratio: 5 / 7; display: grid; place-content: center; justify-items: center; gap: 8px; border-radius: 18px; border: 2px dashed var(--bk-line); background: transparent; color: var(--bk-muted); font-size: 12.5px; font-weight: 800; transition: all 0.2s; }
.th-addtile i { font-size: 26px; color: var(--bk-accent); }
.th-addtile:hover { border-color: var(--bk-accent); color: var(--bk-text); }
.th-note { margin-top: 12px; font-size: 12px; color: var(--bk-muted); }
.th-note i { color: var(--bk-gold); }
.th-hint { font-size: 12px; line-height: 1.5; color: var(--bk-muted); }

/* ---- card de jugador (pcard) estilo videojuego ---- */
.pcard { position: relative; display: block; width: 100%; aspect-ratio: 5 / 7; container-type: inline-size; cursor: pointer; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4)); transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.pcard:hover { transform: translateY(-4px) rotate(-0.8deg); }
.pcard:active { transform: scale(0.97); }
.pcard:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: 3px; border-radius: 14px; }
.pcard.is-big { width: min(64%, 250px); margin: 0 auto; cursor: default; }
.pcard.is-big:hover { transform: none; }
.pcard-shell { position: absolute; inset: 0; clip-path: polygon(11% 0, 89% 0, 100% 6.5%, 100% 90%, 50% 100%, 0 90%, 0 6.5%); background: linear-gradient(155deg, var(--f1), var(--f2) 55%, var(--f3)); }
.pcard-shell::before { content: ''; position: absolute; inset: 1.6cqw; clip-path: polygon(11% 0, 89% 0, 100% 6.5%, 100% 90%, 50% 100%, 0 90%, 0 6.5%); background: linear-gradient(155deg, color-mix(in srgb, var(--f1) 70%, #fff), var(--f2) 60%, color-mix(in srgb, var(--f3) 85%, #000)); opacity: 0.55; }
.pcard-lines { position: absolute; inset: 0; background: repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.16) 0 2cqw, transparent 2cqw 7cqw); opacity: 0.35; }
.pcard-left { position: absolute; left: 7%; top: 11%; width: 23%; display: grid; justify-items: center; gap: 2cqw; color: var(--ft); }
.pcard-ovr { font-family: var(--font-display); font-weight: 900; font-size: 16cqw; line-height: 0.95; letter-spacing: -0.02em; }
.pcard-pos { font-size: 7cqw; font-weight: 900; letter-spacing: 0.06em; padding-bottom: 2cqw; border-bottom: 1.2cqw solid var(--fl); }
.pcard-crest { line-height: 0; margin-top: 1cqw; }
.pcard-crest svg { width: 11cqw; height: auto; }
.pcard-photo { position: absolute; right: 3%; top: 8%; width: 62%; height: 52%; overflow: hidden; line-height: 0; -webkit-mask-image: linear-gradient(#000 76%, transparent); mask-image: linear-gradient(#000 76%, transparent); }
.pcard-photo img, .pcard-photo svg { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.pcard-name { position: absolute; left: 6%; right: 6%; top: 60%; text-align: center; font-family: var(--font-display); font-weight: 900; font-size: 10.5cqw; letter-spacing: 0.04em; color: var(--ft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 1.6cqw; border-bottom: 1px solid var(--fl); }
.pcard-stats { position: absolute; left: 12%; right: 12%; top: 71.5%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4cqw 3cqw; color: var(--ft); }
.pcard-stats span { display: flex; align-items: baseline; justify-content: center; gap: 1.5cqw; font-size: 6.2cqw; font-weight: 800; letter-spacing: 0.02em; }
.pcard-stats b { font-size: 8.8cqw; font-weight: 900; }
.pcard-num { font-size: 6.2cqw; font-weight: 900; letter-spacing: 0.04em; color: var(--fl); margin-top: 0.5cqw; }
.pcard-cap { position: absolute; left: 31%; top: 9.5%; width: 11cqw; height: 11cqw; border-radius: 50%; display: grid; place-items: center; background: #F4C95D; color: #3D2D00; font-family: var(--font-display); font-weight: 900; font-size: 7.5cqw; box-shadow: 0 0 0 1.2cqw #7A5B05, 0 2px 6px rgba(0, 0, 0, 0.4); }

/* ---- hojas del hub ---- */
.th-pview { display: grid; gap: 14px; }
.th-pmeta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.th-pmeta span { text-align: center; padding: 9px 4px; border-radius: 12px; background: var(--bk-card); border: 1px solid var(--bk-line); }
.th-pmeta small { display: block; font-size: 9px; font-weight: 800; letter-spacing: 0.14em; color: var(--bk-muted); }
.th-pmeta b { font-family: var(--font-display); font-size: 16px; }
.th-pinfo { display: grid; gap: 12px; }
.th-bars { display: grid; gap: 7px; }
.th-bars > div { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; }
.th-bars span { color: var(--bk-muted); }
.th-bars i { height: 8px; border-radius: 8px; background: var(--bk-line); overflow: hidden; }
.th-bars em { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--bk-accent), var(--bk-accent2)); animation: thBar 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; transform-origin: left; }
@keyframes thBar { from { transform: scaleX(0); } }
.th-gold { color: var(--bk-gold); border-color: var(--bk-gold); }
.th-form { display: grid; gap: 12px; }
.th-field { display: grid; gap: 5px; }
.th-field > span { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bk-muted); }
.th-field small { font-size: 11px; color: var(--bk-muted); }
.th-field input, .th-field textarea, .th-field select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: var(--bk-card); color: var(--bk-text); font-family: inherit; font-size: 14.5px; outline: none; resize: none; transition: border-color 0.2s, box-shadow 0.2s; }
.th-field select option { color: #111; }
.th-field input:focus, .th-field textarea:focus, .th-field select:focus { border-color: var(--bk-accent); box-shadow: 0 0 0 3px var(--bk-glow); }
.th-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.th-photo-row { display: flex; align-items: center; gap: 14px; }
.th-avatar { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; border: 3px solid var(--bk-accent); box-shadow: 0 0 0 4px var(--bk-glow); flex-shrink: 0; line-height: 0; background: var(--bk-card); }
.th-avatar img, .th-avatar svg { width: 100%; height: 100%; object-fit: cover; }
.th-photo-btns { display: grid; gap: 8px; flex: 1; }
.th-photo-btns button { padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 12.5px; font-weight: 800; text-align: left; }
.th-photo-btns button i { width: 18px; margin-right: 6px; color: var(--bk-accent); }
.is-hidden { display: none !important; }
.th-look { display: grid; gap: 10px; padding: 10px; border-radius: 14px; border: 1px dashed var(--bk-line); }
.th-look small { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; color: var(--bk-muted); margin-bottom: 6px; }
.th-sws { display: flex; gap: 8px; flex-wrap: wrap; }
.th-sws button { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid var(--bk-line); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); transition: transform 0.18s; }
.th-sws button.is-on { border-color: var(--bk-accent); transform: scale(1.15); box-shadow: 0 0 0 2px var(--bk-accent); }
.th-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.th-chips button { padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--bk-line); background: var(--bk-card); font-size: 12px; font-weight: 700; }
.th-chips button.is-on { background: var(--bk-accent); border-color: var(--bk-accent); color: var(--bk-ink); }
.th-slider { display: grid; grid-template-columns: 38px 1fr 30px; align-items: center; gap: 8px; margin-bottom: 4px; }
.th-slider span { font-size: 11.5px; font-weight: 800; color: var(--bk-muted); }
.th-slider input[type="range"] { width: 100%; accent-color: var(--bk-accent); }
.th-slider b { font-size: 13px; text-align: right; }
.th-ovr { margin-left: 8px; padding: 2px 9px; border-radius: 8px; background: var(--bk-accent); color: var(--bk-ink); font-size: 13px; letter-spacing: 0; }
.th-remove { padding: 12px; border-radius: 12px; border: 1.5px solid rgba(239, 68, 68, 0.45); background: transparent; color: #EF4444; font-weight: 800; font-size: 13px; }
.th-crop { position: relative; width: 260px; height: 260px; margin: 4px auto 14px; border-radius: 16px; overflow: hidden; background: #000; touch-action: none; }
.th-crop canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.th-crop-ring { position: absolute; inset: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 400px rgba(0, 0, 0, 0.55); pointer-events: none; }
.th-zoom { grid-template-columns: 24px 1fr; }

/* ---- capitanía ---- */
.th-cap-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.th-cap-face { position: relative; width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--bk-gold); box-shadow: 0 0 0 3px rgba(244, 201, 93, 0.25); flex-shrink: 0; line-height: 0; }
.th-cap-face > svg, .th-cap-face > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.th-armband { position: absolute; right: -6px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #F4C95D; color: #3D2D00; font-style: normal; font-weight: 900; font-size: 13px; box-shadow: 0 0 0 2px var(--bk-bg2); line-height: 1; }
.th-cap-row strong { display: block; font-size: 15px; }
.th-cap-row small { font-size: 12px; color: var(--bk-muted); }
.th-pass { width: 100%; margin-top: 12px; background: linear-gradient(135deg, #FFE08A, #F4C95D); color: #231A00; box-shadow: 0 10px 24px rgba(244, 201, 93, 0.35); }
.th-log { list-style: none; margin-top: 14px; display: grid; gap: 8px; }
.th-log li { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--bk-muted); }
.th-log li i { color: var(--bk-gold); font-size: 11px; }
.th-log li span { flex: 1; color: var(--bk-text); }
.th-log small { font-size: 10.5px; }
.th-picks { display: grid; gap: 8px; margin-bottom: 12px; }
.th-pick { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--bk-line); background: var(--bk-card); transition: all 0.2s; }
.th-pick.is-on { border-color: var(--bk-gold); background: rgba(244, 201, 93, 0.1); box-shadow: 0 0 0 1px var(--bk-gold); }
.th-pick-face { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex-shrink: 0; line-height: 0; border: 2px solid var(--bk-line); }
.th-pick-face img, .th-pick-face svg { width: 100%; height: 100%; object-fit: cover; }
.th-pick > span:nth-child(2) { flex: 1; min-width: 0; }
.th-pick b { display: block; font-size: 14px; }
.th-pick small { font-size: 11.5px; color: var(--bk-muted); }
.th-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bk-line); position: relative; flex-shrink: 0; }
.th-pick.is-on .th-radio { border-color: var(--bk-gold); }
.th-pick.is-on .th-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--bk-gold); }
.th-warn { font-size: 12px; line-height: 1.5; color: var(--bk-muted); padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(244, 201, 93, 0.6); }
.th-warn i { color: var(--bk-gold); margin-right: 6px; }
.th-viewas {
  display: grid;
  gap: 8px;
  margin: 14px 0 10px 0;
}
.th-viewas span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--km-lime, #32C736);
  display: flex;
  align-items: center;
  gap: 6px;
}
.th-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.th-viewas select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 13px 42px 13px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(50, 199, 54, 0.4);
  background: rgba(18, 24, 34, 0.95);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}
.th-viewas select:hover {
  border-color: var(--km-lime, #32C736);
  background: rgba(24, 32, 46, 0.98);
  box-shadow: 0 0 14px rgba(50, 199, 54, 0.25);
}
.th-viewas select:focus {
  border-color: var(--km-lime, #32C736);
  box-shadow: 0 0 0 3px rgba(50, 199, 54, 0.25), 0 6px 18px rgba(0, 0, 0, 0.5);
}
.th-viewas select option {
  background: #111827;
  color: #FFFFFF;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}
.th-select-arrow {
  position: absolute;
  right: 14px;
  pointer-events: none;
  font-size: 12px;
  color: var(--km-lime, #32C736);
  transition: transform 0.2s ease;
}
.th-viewas select:focus + .th-select-arrow {
  transform: rotate(180deg);
}
[data-theme="light"] .th-viewas select {
  background: #FFFFFF;
  color: #111827;
  border-color: rgba(20, 112, 42, 0.4);
}
[data-theme="light"] .th-viewas select option {
  background: #FFFFFF;
  color: #111827;
}
.th-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--bk-muted, #94A3B8);
  cursor: pointer;
  transition: all 0.2s;
}
.th-reset:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

/* ---- Perfil: tarjeta del equipo, carnet y plantilla sincronizados ---- */
.ts-kit { position: relative; width: 78px; height: 118px; flex-shrink: 0; }
.ts-kit-fig svg { height: 118px; width: auto; display: block; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); }
.ts-kit-crest { position: absolute; right: -18px; bottom: 0; line-height: 0; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4)); }
.squad-face { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0; line-height: 0; border: 2px solid var(--km-stroke); }
.squad-face img, .squad-face svg { width: 100%; height: 100%; object-fit: cover; }
.squad-row[data-pid] { cursor: pointer; transition: background 0.2s, transform 0.15s; }
.squad-row[data-pid]:hover { background: color-mix(in srgb, var(--km-lime) 10%, var(--km-surface-variant)); }
.squad-row[data-pid]:active { transform: scale(0.99); }
.squad-cap { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #F4C95D; color: #3D2D00; font-weight: 900; font-size: 12px; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(244, 201, 93, 0.35); }
.squad-ovr { font-family: var(--font-display); font-weight: 900; font-size: 13px; color: var(--km-lime); min-width: 24px; text-align: right; }
.player-avatar-ring img, .avatar-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.player-avatar-ring { overflow: hidden; }
.share-card-preview { display: grid; place-items: center; padding: 6px 0 2px; }
.share-card-preview .th-cardsvg { width: min(64%, 220px); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45)); }

[data-theme="light"] .th-pass { color: #231A00; }
[data-theme="light"] .th-role.is-cap { color: #92680A; border-color: #92680A; }
[data-theme="light"] .th-note i, [data-theme="light"] .th-log li i { color: #B7860B; }
[data-theme="light"] .squad-ovr { color: #14702A; }
@media (max-width: 360px) { .th-squad { gap: 8px; } .th-pmeta { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .th-sheen, .th-card-wrap { animation: none; } }

/* ---- Plantilla del Perfil (filas con foto) ---- */
.sq2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--km-surface-variant); border-radius: 12px; border: 1px solid var(--km-stroke); }
.sq2.is-cap { border-color: rgba(244, 201, 93, 0.55); }
.sq2-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sq2-face { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0; line-height: 0; border: 1.5px solid var(--km-lime); }
.sq2.is-cap .sq2-face { border-color: #F4C95D; }
.sq2-face img, .sq2-face svg { width: 100%; height: 100%; object-fit: cover; }
.sq2-txt { min-width: 0; }
.sq2-txt strong { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--km-white); min-width: 0; }
.sq2-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sq2-face { position: relative; overflow: visible; }
.sq2-face img, .sq2-face svg { border-radius: 50%; }
.sq2-cband { position: absolute; right: -5px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: #F4C95D; color: #3D2D00; font-style: normal; font-weight: 900; font-size: 10px; box-shadow: 0 0 0 2px var(--km-surface-variant); line-height: 1; }
.sq2-txt small { display: block; font-size: 10.5px; color: var(--km-neutral); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq2.is-cap .sq2-txt small { color: var(--km-lime); font-weight: 700; }
.sq2-num { font-style: normal; flex-shrink: 0; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 900; background: var(--km-stroke); color: var(--km-white); }
.sq2.is-cap .sq2-num { background: #F4C95D; color: #0B0C0E; }
.sq2-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sq2-badge { font-size: 9px; font-weight: 900; letter-spacing: 0.04em; padding: 3px 7px; border-radius: 999px; background: var(--km-stroke); color: var(--km-muted); }
.sq2-badge.is-on { background: rgba(50, 199, 54, 0.2); color: var(--km-lime); }
[data-theme="light"] .sq2-num { color: #0F1A13; }
[data-theme="light"] .sq2.is-cap .sq2-num { color: #0B0C0E; }
[data-theme="light"] .sq2-badge.is-on { color: #14702A; background: rgba(28, 154, 42, 0.14); }

/* ==========================================================================
   Host de hojas fuera de pantallas superpuestas + estallido de confirmación
   ========================================================================== */
.ts-vars {
  --bk-bg: #05090A; --bk-bg2: #0B1511; --bk-card: rgba(255, 255, 255, 0.05); --bk-card-solid: #101A15; --bk-line: rgba(255, 255, 255, 0.12);
  --bk-text: #FFFFFF; --bk-muted: #9DB0A4; --bk-accent: #32C736; --bk-accent2: #8CFF6B; --bk-ink: #07110A; --bk-gold: #F4C95D; --bk-glow: rgba(50, 199, 54, 0.45);
}
[data-theme="light"] .ts-vars {
  --bk-bg: #EEF4F0; --bk-bg2: #FFFFFF; --bk-card: rgba(15, 26, 19, 0.04); --bk-card-solid: #FFFFFF; --bk-line: rgba(15, 26, 19, 0.14);
  --bk-text: #0F1A13; --bk-muted: #54655B; --bk-accent: #14702A; --bk-accent2: #22A935; --bk-ink: #FFFFFF; --bk-gold: #B7860B; --bk-glow: rgba(20, 112, 42, 0.32);
}
.ts-sheethost { position: absolute; inset: 0; z-index: 700; pointer-events: none; color: var(--bk-text); font-family: var(--font-body); overflow: hidden; }
.ts-sheethost > .bk-sheet { pointer-events: auto; z-index: 1; }
.ts-sheethost button { font-family: inherit; color: inherit; cursor: pointer; }
.ts-sheethost > .bk-confetti { z-index: 5; }
.ts-burst { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; animation: bkFade 0.2s ease both; }
.ts-burst.out { animation: bkFadeOut 0.4s ease both; }
.ts-burst-card { display: grid; justify-items: center; gap: 12px; padding: 24px 30px; border-radius: 24px; background: color-mix(in srgb, var(--bk-bg2, #0B1511) 92%, transparent); border: 1.5px solid var(--bk-accent, #32C736); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 40px var(--bk-glow, rgba(50, 199, 54, 0.4)); backdrop-filter: blur(10px); animation: tsPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; max-width: 82%; text-align: center; color: var(--bk-text, #fff); }
.ts-burst-card strong { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 20px; letter-spacing: 0.02em; }
.ts-burst-ring { position: relative; width: 74px; height: 74px; display: grid; place-items: center; }
.ts-burst-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ts-burst-ring circle { fill: rgba(50, 199, 54, 0.14); stroke: var(--bk-accent, #32C736); stroke-width: 3; stroke-dasharray: 145; stroke-dashoffset: 145; animation: tsDraw 0.6s 0.1s ease forwards; transform-origin: center; transform: rotate(-90deg); }
.ts-burst-ring path { fill: none; stroke: var(--bk-accent, #32C736); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: tsDraw 0.4s 0.55s ease forwards; }
.ts-burst-ring i { display: none; }
@keyframes tsDraw { to { stroke-dashoffset: 0; } }
@keyframes tsPop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ts-burst-card, .ts-burst-ring circle, .ts-burst-ring path { animation-duration: 0.01ms !important; animation-delay: 0s !important; } }

/* Cards de jugador sin club (agentes libres) */
.pcard-free { font-style: normal; font-weight: 900; font-size: 5.4cqw; letter-spacing: 0.06em; padding: 1cqw 2.4cqw; border-radius: 99px; border: 0.8cqw solid var(--fl); color: var(--fl); line-height: 1; }
