/**
 * JuegaDeportes - Frontend Styles
 */

/* === Variables === */
:root {
    --jd-primary: #2563eb;
    --jd-primary-dark: #1d4ed8;
    --jd-primary-soft: #eff6ff;
    --jd-primary-soft-2: #dbeafe;
    --jd-primary-strong: #1e40af;
    --jd-primary-deep: #1e3a5f;
    --jd-primary-mid: #93c5fd;
    --jd-success: #16a34a;
    --jd-danger: #dc2626;
    --jd-warning: #f59e0b;
    --jd-gray-50: #f9fafb;
    --jd-gray-100: #f3f4f6;
    --jd-gray-200: #e5e7eb;
    --jd-gray-300: #d1d5db;
    --jd-gray-500: #6b7280;
    --jd-gray-700: #374151;
    --jd-gray-900: #111827;
    --jd-radius: 8px;
    --jd-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --jd-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

/* === Grids === */
.jd-teams-grid,
.jd-venues-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}
.jd-grid-2 { grid-template-columns: repeat(2, 1fr); }
.jd-grid-3 { grid-template-columns: repeat(3, 1fr); }
.jd-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .jd-grid-2, .jd-grid-3, .jd-grid-4 {
        grid-template-columns: 1fr;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .jd-grid-3, .jd-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Cards === */
.jd-team-card,
.jd-venue-card {
    background: #fff;
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.jd-team-card:hover,
.jd-venue-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--jd-shadow-md);
}

.jd-team-card-thumb img,
.jd-venue-card-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.jd-team-placeholder-logo,
.jd-venue-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--jd-gray-100);
}
.jd-team-placeholder-logo .dashicons,
.jd-venue-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--jd-gray-300);
}

.jd-team-card-content,
.jd-venue-card-content {
    padding: 16px;
}
.jd-team-name,
.jd-venue-name {
    margin: 0 0 8px;
    font-size: 1.1em;
}
.jd-team-name a,
.jd-venue-name a {
    text-decoration: none;
    color: var(--jd-gray-900);
}
.jd-team-name a:hover,
.jd-venue-name a:hover {
    color: var(--jd-primary);
}
.jd-team-sport {
    display: inline-block;
    font-size: 0.85em;
    color: var(--jd-gray-500);
    margin-bottom: 8px;
}
.jd-team-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.jd-stat-item {
    font-size: 0.85em;
    color: var(--jd-gray-700);
}

/* === Venue Meta === */
.jd-venue-address {
    font-size: 0.9em;
    color: var(--jd-gray-500);
    margin: 4px 0;
}
.jd-venue-address .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}
.jd-venue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    font-size: 0.85em;
}
.jd-venue-surface {
    background: var(--jd-gray-100);
    padding: 2px 8px;
    border-radius: 4px;
}
.jd-venue-price {
    font-weight: 600;
    color: var(--jd-success);
}

/* === Level Badges === */
.jd-level-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}
.jd-level-novato { background: #e0e7ff; color: #3730a3; }
.jd-level-amateur { background: #d1fae5; color: #065f46; }
.jd-level-competitivo { background: #fef3c7; color: #92400e; }
.jd-level-elite { background: #fce7f3; color: #9d174d; }
.jd-level-leyenda { background: #fef08a; color: #854d0e; border: 1px solid #f59e0b; }

/* === Rankings Table === */
.jd-rankings-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}
.jd-rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    overflow: hidden;
}
.jd-rankings-table thead {
    background: var(--jd-gray-900);
    color: #fff;
}
.jd-rankings-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
}
.jd-rankings-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--jd-gray-200);
}
.jd-rankings-table tbody tr:hover {
    background: var(--jd-gray-50);
}
.jd-rank-top td {
    background: #fffbeb;
}
.jd-rankings-table .jd-rank-pos {
    width: 50px;
    text-align: center;
    font-weight: 700;
}
.jd-rankings-table .jd-rank-team a {
    text-decoration: none;
    color: var(--jd-gray-900);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.jd-rank-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.jd-medal { font-size: 1.2em; }

/* === Challenges === */
.jd-challenges-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}
.jd-challenge-card {
    background: #fff;
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    padding: 16px 20px;
    border-left: 4px solid var(--jd-gray-300);
}
.jd-challenge-pending { border-left-color: var(--jd-warning); }
.jd-challenge-accepted { border-left-color: var(--jd-primary); }
.jd-challenge-confirmed { border-left-color: var(--jd-success); }
.jd-challenge-rejected { border-left-color: var(--jd-danger); }

.jd-challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.jd-challenge-sport {
    font-size: 0.85em;
    color: var(--jd-gray-500);
    text-transform: uppercase;
    font-weight: 600;
}
.jd-challenge-status {
    font-size: 0.8em;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.jd-status-pending { background: #fef3c7; color: #92400e; }
.jd-status-accepted { background: var(--jd-primary-soft-2); color: var(--jd-primary-strong); }
.jd-status-confirmed { background: #d1fae5; color: #065f46; }
.jd-status-rejected { background: #fee2e2; color: #991b1b; }
.jd-status-played { background: #e0e7ff; color: #3730a3; }
.jd-status-cancelled { background: var(--jd-gray-100); color: var(--jd-gray-500); }

.jd-challenge-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
}
.jd-challenge-team {
    text-align: center;
    flex: 1;
}
.jd-challenge-team a {
    text-decoration: none;
    color: var(--jd-gray-900);
    font-weight: 600;
    font-size: 1.1em;
}
.jd-challenge-vs {
    font-weight: 900;
    font-size: 1.2em;
    color: var(--jd-gray-300);
}
.jd-score {
    display: block;
    font-size: 1.8em;
    font-weight: 900;
    color: var(--jd-primary);
    margin-top: 4px;
}
.jd-challenge-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.85em;
    color: var(--jd-gray-500);
}

/* === Buttons === */
.jd-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.jd-btn:active { transform: scale(0.97); }
.jd-btn-primary { background: var(--jd-primary); color: #fff; }
.jd-btn-primary:hover { background: var(--jd-primary-dark); }
.jd-btn-success { background: var(--jd-success); color: #fff; }
.jd-btn-success:hover { background: #15803d; }
.jd-btn-danger { background: var(--jd-danger); color: #fff; }
.jd-btn-danger:hover { background: #b91c1c; }
.jd-btn-large { padding: 12px 24px; font-size: 1em; }

/* === Forms === */
.jd-form {
    max-width: 600px;
    margin: 20px 0;
}
.jd-form-row {
    margin-bottom: 16px;
}
.jd-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--jd-gray-700);
}
.jd-form-row input[type="text"],
.jd-form-row input[type="number"],
.jd-form-row input[type="email"],
.jd-form-row input[type="tel"],
.jd-form-row input[type="password"],
.jd-form-row input[type="date"],
.jd-form-row input[type="datetime-local"],
.jd-form-row select,
.jd-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--jd-gray-300);
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.jd-form-row input:focus,
.jd-form-row select:focus,
.jd-form-row textarea:focus {
    outline: none;
    border-color: var(--jd-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.jd-form-help {
    display: block;
    font-size: 0.8em;
    color: var(--jd-gray-500);
    margin-top: 4px;
}
.jd-form-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 12px;
    font-weight: 500;
}
.jd-form-message.jd-msg-success {
    background: #d1fae5;
    color: #065f46;
}
.jd-form-message.jd-msg-error {
    background: #fee2e2;
    color: #991b1b;
}

/* === My Team Panel === */
.jd-my-team-panel {
    margin: 20px 0;
}
.jd-my-team-item {
    background: #fff;
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.jd-my-team-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0;
    align-items: center;
}
.jd-pending-challenges {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--jd-gray-200);
}
.jd-pending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--jd-gray-100);
}
.jd-pending-actions {
    display: flex;
    gap: 8px;
}
.jd-login-required {
    text-align: center;
    padding: 40px;
    background: var(--jd-gray-50);
    border-radius: var(--jd-radius);
}

/* === Team Profile === */
.jd-team-profile {
    margin: 20px 0;
}
.jd-team-profile-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 30px;
}
.jd-team-profile-avatar img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--jd-radius);
}
.jd-profile-stats-row {
    display: flex;
    gap: 24px;
    margin: 16px 0;
}
.jd-profile-stat {
    text-align: center;
}
.jd-profile-stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: 900;
    color: var(--jd-gray-900);
}
.jd-profile-stat-label {
    display: block;
    font-size: 0.8em;
    color: var(--jd-gray-500);
    text-transform: uppercase;
}

/* === History === */
.jd-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.jd-history-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--jd-gray-100);
}
.jd-history-points {
    font-weight: 700;
    min-width: 50px;
}
.jd-points-positive .jd-history-points { color: var(--jd-success); }
.jd-points-negative .jd-history-points { color: var(--jd-danger); }
.jd-history-desc { flex: 1; color: var(--jd-gray-700); }
.jd-history-date { font-size: 0.85em; color: var(--jd-gray-500); }

/* === No results === */
.jd-no-results {
    text-align: center;
    padding: 30px;
    color: var(--jd-gray-500);
    font-style: italic;
}

/* === Responsive === */
@media (max-width: 600px) {
    .jd-challenge-teams { flex-direction: column; gap: 8px; }
    .jd-team-profile-header { flex-direction: column; align-items: center; text-align: center; }
    .jd-profile-stats-row { flex-wrap: wrap; justify-content: center; }
    .jd-pending-item { flex-direction: column; gap: 8px; text-align: center; }
}

/* === Buy Points / Packages === */
.jd-buy-points-wrapper {
    margin: 20px 0;
}
.jd-buy-header {
    text-align: center;
    margin-bottom: 24px;
}
.jd-buy-subtitle {
    color: var(--jd-gray-500);
    font-size: 1.1em;
}
.jd-buy-team-select {
    max-width: 400px;
    margin: 0 auto 32px;
    text-align: center;
}
.jd-buy-team-select select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--jd-gray-300);
    border-radius: 6px;
    font-size: 1em;
    margin-top: 8px;
}

.jd-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 24px 0;
}
.jd-package-card {
    background: #fff;
    border: 2px solid var(--jd-gray-200);
    border-radius: var(--jd-radius);
    padding: 24px 16px;
    text-align: center;
    position: relative;
    transition: border-color 0.2s, transform 0.2s;
}
.jd-package-card:hover {
    border-color: var(--jd-primary);
    transform: translateY(-3px);
}
.jd-package-popular {
    border-color: var(--jd-primary);
    box-shadow: var(--jd-shadow-md);
}
.jd-package-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--jd-primary);
    color: #fff;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
}
.jd-package-name {
    margin: 8px 0;
    font-size: 1em;
    color: var(--jd-gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.jd-package-points {
    margin: 12px 0;
}
.jd-package-number {
    font-size: 2.5em;
    font-weight: 900;
    color: var(--jd-gray-900);
    display: block;
}
.jd-package-label {
    font-size: 0.85em;
    color: var(--jd-gray-500);
}
.jd-package-price {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--jd-primary);
    margin: 12px 0;
}
.jd-package-savings {
    font-size: 0.8em;
    color: var(--jd-success);
    font-weight: 600;
    margin-bottom: 12px;
}
.jd-buy-info {
    background: var(--jd-gray-50);
    border-radius: var(--jd-radius);
    padding: 24px;
    margin-top: 32px;
}
.jd-buy-info h4 {
    margin-top: 0;
}
.jd-buy-info ul {
    padding-left: 20px;
}
.jd-buy-info li {
    margin: 8px 0;
    color: var(--jd-gray-700);
}

/* === Wallet === */
.jd-wallet-wrapper {
    margin: 20px 0;
}
.jd-wallet-team {
    background: #fff;
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.jd-wallet-header {
    background: linear-gradient(135deg, var(--jd-primary-deep) 0%, var(--jd-primary) 100%);
    color: #fff;
    padding: 24px;
    text-align: center;
}
.jd-wallet-header h3 {
    margin: 0 0 12px;
    color: #fff;
}
.jd-wallet-balance {
    margin: 16px 0;
}
.jd-wallet-points {
    display: block;
    font-size: 3em;
    font-weight: 900;
}
.jd-wallet-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 4px;
}
.jd-wallet-cop {
    display: block;
    font-size: 1.1em;
    opacity: 0.9;
    margin-top: 4px;
}
.jd-wallet-header .jd-btn {
    margin-top: 16px;
}
.jd-wallet-history {
    padding: 20px;
}
.jd-wallet-history h4 {
    margin-top: 0;
}
.jd-wallet-table {
    width: 100%;
    border-collapse: collapse;
}
.jd-wallet-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--jd-gray-50);
    font-size: 0.85em;
    color: var(--jd-gray-500);
    text-transform: uppercase;
}
.jd-wallet-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--jd-gray-100);
    font-size: 0.9em;
}
.jd-mov-amount {
    font-weight: 700;
    text-align: right;
}
.jd-mov-positive .jd-mov-amount { color: var(--jd-success); }
.jd-mov-negative .jd-mov-amount { color: var(--jd-danger); }

/* === Tournaments === */
.jd-tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.jd-tournament-card {
    background: #fff;
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    overflow: hidden;
    transition: transform 0.2s;
}
.jd-tournament-card:hover { transform: translateY(-2px); }
.jd-tournament-thumb img { width: 100%; height: 160px; object-fit: cover; }
.jd-tournament-card-body { padding: 16px; }
.jd-tournament-status-badge {
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 8px;
    display: inline-block;
}
.jd-tournament-title { margin: 4px 0 8px; font-size: 1.15em; }
.jd-tournament-title a { text-decoration: none; color: var(--jd-gray-900); }
.jd-tournament-title a:hover { color: var(--jd-primary); }
.jd-tournament-sport { font-size: 0.85em; color: var(--jd-gray-500); }
.jd-tournament-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin: 12px 0; font-size: 0.85em; color: var(--jd-gray-700);
}
.jd-tournament-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 12px; border-top: 1px solid var(--jd-gray-200);
    font-size: 0.9em;
}
.jd-tournament-fee { font-weight: 600; }
.jd-tournament-prize { color: var(--jd-warning); font-weight: 600; }

/* Tournament detail */
.jd-tournament-detail { margin: 20px 0; }
.jd-tournament-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px;
}
.jd-tournament-info-card {
    background: #fff; border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow); padding: 20px;
}
.jd-tournament-info-card h4 { margin-top: 0; }
.jd-tournament-info-card ul { list-style: none; padding: 0; }
.jd-tournament-info-card li { padding: 6px 0; border-bottom: 1px solid var(--jd-gray-100); }
.jd-tournament-pool { margin-top: 12px; font-size: 1.1em; color: var(--jd-primary); }
.jd-tournament-rules {
    background: var(--jd-gray-50); border-radius: var(--jd-radius);
    padding: 16px 20px; margin-bottom: 24px;
}
.jd-tournament-register-section {
    background: #fff; border: 2px dashed var(--jd-primary);
    border-radius: var(--jd-radius); padding: 20px; margin: 20px 0; text-align: center;
}
.jd-tournament-register-form {
    display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.jd-tournament-register-form select {
    padding: 10px 12px; border: 1px solid var(--jd-gray-300); border-radius: 6px;
}
.jd-tournament-teams-grid {
    display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0;
}
.jd-tournament-team-item {
    background: var(--jd-gray-50); padding: 6px 14px;
    border-radius: 20px; font-size: 0.9em;
}
.jd-tournament-team-item a { text-decoration: none; color: var(--jd-gray-900); font-weight: 500; }
.jd-eliminated { opacity: 0.5; text-decoration: line-through; }
.jd-elim-badge { font-size: 0.75em; color: var(--jd-danger); }

/* === Bracket === */
.jd-bracket {
    display: flex; gap: 24px; overflow-x: auto;
    padding: 20px 0; margin: 20px 0;
}
.jd-bracket-round {
    min-width: 200px; display: flex; flex-direction: column;
}
.jd-bracket-round-title {
    text-align: center; font-size: 0.8em; text-transform: uppercase;
    color: var(--jd-gray-500); margin-bottom: 16px; letter-spacing: 0.5px;
}
.jd-bracket-matches {
    display: flex; flex-direction: column;
    justify-content: space-around; flex: 1; gap: 12px;
}
.jd-bracket-match {
    background: #fff; border: 1px solid var(--jd-gray-200);
    border-radius: 6px; overflow: hidden;
}
.jd-match-finished { border-color: var(--jd-success); }
.jd-match-pending { border-color: var(--jd-warning); }
.jd-bracket-team {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; font-size: 0.85em;
    border-bottom: 1px solid var(--jd-gray-100);
}
.jd-bracket-team:last-child { border-bottom: none; }
.jd-bracket-winner {
    background: #d1fae5; font-weight: 700;
}
.jd-bracket-name { flex: 1; }
.jd-bracket-score {
    font-weight: 900; font-size: 1.1em;
    min-width: 24px; text-align: center;
}

@media (max-width: 768px) {
    .jd-tournament-info-grid { grid-template-columns: 1fr; }
    .jd-bracket { flex-direction: column; }
    .jd-bracket-round { min-width: unset; }
}

/* === Venue Panel === */
.jd-venue-panel { margin: 20px 0; }
.jd-venue-panel-name { font-size: 1.2em; color: var(--jd-primary); margin-bottom: 20px; }
.jd-venue-section {
    background: #fff; border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow); padding: 24px; margin-bottom: 24px;
}
.jd-venue-section h3 { margin-top: 0; }
.jd-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.jd-form-grid .jd-form-row { margin-bottom: 0; }
@media (max-width: 600px) { .jd-form-grid { grid-template-columns: 1fr; } }

/* === Rewards Shop === */
.jd-shop-header { text-align: center; margin-bottom: 24px; }
.jd-shop-team-bar {
    display: flex; align-items: center; gap: 12px; justify-content: center;
    margin-bottom: 24px; padding: 12px; background: var(--jd-gray-50); border-radius: var(--jd-radius);
}
.jd-shop-team-bar select { padding: 8px 12px; border: 1px solid var(--jd-gray-300); border-radius: 6px; }
.jd-shop-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
.jd-reward-card {
    background: #fff; border-radius: var(--jd-radius); box-shadow: var(--jd-shadow);
    overflow: hidden; transition: transform 0.2s;
}
.jd-reward-card:hover { transform: translateY(-2px); }
.jd-reward-thumb img { width: 100%; height: 160px; object-fit: cover; }
.jd-reward-icon {
    width: 100%; height: 160px; display: flex; align-items: center; justify-content: center;
    background: var(--jd-gray-100); font-size: 3em;
}
.jd-reward-body { padding: 16px; }
.jd-reward-cat { font-size: 0.75em; color: var(--jd-gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.jd-reward-title { margin: 6px 0; font-size: 1.05em; }
.jd-reward-desc { font-size: 0.85em; color: var(--jd-gray-500); margin: 6px 0; }
.jd-reward-meta { display: flex; justify-content: space-between; margin: 12px 0; font-size: 0.9em; }
.jd-reward-cost { font-weight: 700; color: var(--jd-primary); }
.jd-reward-stock { color: var(--jd-gray-500); }
.jd-reward-level { font-size: 0.8em; color: var(--jd-warning); display: block; margin-bottom: 8px; }
.jd-redeem-btn { width: 100%; margin-top: 8px; }

/* === XP Profile === */
.jd-xp-profile { margin: 20px 0; }
.jd-xp-header {
    display: flex; gap: 24px; align-items: center;
    background: linear-gradient(135deg, #111827 0%, var(--jd-primary-deep) 100%);
    color: #fff; padding: 30px; border-radius: var(--jd-radius); margin-bottom: 24px;
}
.jd-xp-avatar img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); }
.jd-xp-info h2 { margin: 0 0 8px; color: #fff; }
.jd-xp-level-display { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.jd-xp-level-icon { font-size: 1.5em; }
.jd-xp-level-name { font-weight: 700; font-size: 1.1em; }
.jd-xp-bar-wrapper { width: 100%; }
.jd-xp-bar {
    width: 100%; height: 10px; background: rgba(255,255,255,0.2);
    border-radius: 5px; overflow: hidden;
}
.jd-xp-bar-fill { height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); border-radius: 5px; transition: width 0.5s; }
.jd-xp-bar-label { font-size: 0.8em; opacity: 0.8; margin-top: 4px; display: block; }

.jd-xp-stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 24px;
}
.jd-xp-stat-card {
    background: #fff; border-radius: var(--jd-radius); box-shadow: var(--jd-shadow);
    padding: 16px; text-align: center;
}
.jd-xp-stat-value { display: block; font-size: 1.6em; font-weight: 900; color: var(--jd-gray-900); }
.jd-xp-stat-label { display: block; font-size: 0.75em; color: var(--jd-gray-500); text-transform: uppercase; margin-top: 4px; }

.jd-xp-section {
    background: #fff; border-radius: var(--jd-radius); box-shadow: var(--jd-shadow);
    padding: 20px; margin-bottom: 20px;
}
.jd-xp-section h3 { margin-top: 0; }

/* Match list */
.jd-match-list { display: flex; flex-direction: column; gap: 8px; }
.jd-match-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-radius: 6px; font-size: 0.9em; background: var(--jd-gray-50);
    border-left: 4px solid var(--jd-gray-300);
}
.jd-match-win { border-left-color: var(--jd-success); background: #f0fdf4; }
.jd-match-loss { border-left-color: var(--jd-danger); background: #fef2f2; }
.jd-match-draw { border-left-color: var(--jd-warning); background: #fffbeb; }
.jd-match-score { font-weight: 900; font-size: 1.1em; min-width: 40px; }
.jd-match-opponent { flex: 1; font-weight: 500; }
.jd-match-venue, .jd-match-date { font-size: 0.85em; color: var(--jd-gray-500); }
.jd-match-pts { font-weight: 700; font-size: 0.85em; }

.jd-match-history-item { flex-wrap: wrap; }
.jd-match-teams-row { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; }
.jd-match-score-big { font-size: 1.3em; font-weight: 900; }
.jd-match-winner-name { font-weight: 700; color: var(--jd-success); }
.jd-match-detail-row { width: 100%; display: flex; gap: 16px; font-size: 0.8em; color: var(--jd-gray-500); margin-top: 6px; justify-content: center; }

/* XP History */
.jd-xp-history { list-style: none; padding: 0; }
.jd-xp-history li {
    display: flex; align-items: center; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--jd-gray-100); font-size: 0.9em;
}
.jd-xp-hist-amount { font-weight: 700; color: var(--jd-success); min-width: 60px; }
.jd-xp-hist-reason { flex: 1; }
.jd-xp-hist-date { color: var(--jd-gray-500); font-size: 0.85em; }

/* Redemption list */
.jd-redemption-list { list-style: none; padding: 0; }
.jd-redemption-list li { padding: 8px 0; border-bottom: 1px solid var(--jd-gray-100); display: flex; gap: 10px; align-items: center; }

@media (max-width: 600px) {
    .jd-xp-header { flex-direction: column; text-align: center; }
    .jd-match-item { flex-wrap: wrap; }
}

/* === Registration Form === */
.jd-register-wrapper { max-width: 700px; margin: 20px auto; }
.jd-register-header { text-align: center; margin-bottom: 30px; }
.jd-form-section {
    background: #fff; border-radius: var(--jd-radius); box-shadow: var(--jd-shadow);
    padding: 24px; margin-bottom: 20px;
}
.jd-form-section h3 { margin-top: 0; margin-bottom: 16px; }
.jd-venue-selector { display: flex; flex-direction: column; gap: 10px; }
.jd-venue-option {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border: 2px solid var(--jd-gray-200); border-radius: var(--jd-radius);
    cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.jd-venue-option:hover { border-color: var(--jd-primary); background: var(--jd-gray-50); }
.jd-venue-option input[type="radio"] { width: 20px; height: 20px; accent-color: var(--jd-primary); }
.jd-venue-option input[type="radio"]:checked ~ .jd-venue-option-content { color: var(--jd-primary); }
.jd-venue-option:has(input:checked) { border-color: var(--jd-primary); background: var(--jd-primary-soft); }
.jd-venue-option-content { display: flex; flex-direction: column; gap: 2px; }
.jd-venue-option-content strong { font-size: 1em; }
.jd-venue-option-address { font-size: 0.85em; color: var(--jd-gray-500); }
.jd-venue-option-meta { font-size: 0.8em; color: var(--jd-gray-500); }
.jd-plan-summary { background: var(--jd-gray-50); border: 1px dashed var(--jd-gray-300); }
.jd-plan-summary ul { list-style: none; padding: 0; }
.jd-plan-summary li { padding: 4px 0; }
.jd-plan-upgrade-hint { font-size: 0.85em; color: var(--jd-gray-500); margin-top: 10px; }
.jd-already-registered { text-align: center; padding: 40px; background: var(--jd-gray-50); border-radius: var(--jd-radius); }

/* === Role Cards === */
.jd-role-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px 0;
}
.jd-role-card {
    background: #fff; border: 2px solid var(--jd-gray-200); border-radius: var(--jd-radius);
    padding: 24px; text-align: center; text-decoration: none; color: var(--jd-gray-900);
    transition: border-color 0.2s, transform 0.2s;
}
.jd-role-card:hover { border-color: var(--jd-primary); transform: translateY(-3px); }
.jd-role-icon { font-size: 2.5em; display: block; margin-bottom: 12px; }
.jd-role-card h3 { margin: 0 0 8px; font-size: 1.05em; }
.jd-role-card p { margin: 0; font-size: 0.85em; color: var(--jd-gray-500); }
.jd-role-coming-soon { opacity: 0.5; pointer-events: none; }

/* === Captcha === */
.jd-captcha-section { background: #fffbeb; border: 1px solid #fbbf24; padding: 16px; border-radius: var(--jd-radius); }
.jd-captcha-section label { font-weight: 700; color: var(--jd-gray-900); }
.jd-captcha-section input[type="number"] {
    width: 100%; max-width: 200px; font-size: 1.2em; font-weight: 700; text-align: center;
    padding: 10px 12px; border: 1px solid var(--jd-gray-300); border-radius: 6px;
}

/* Captcha matemático global (inyectado por JS y JD_Security::render_captcha) */
.jd-captcha {
    display: block;
    margin: 22px 0 26px;
    padding: 24px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 14px;
    text-align: center;
}
.jd-captcha-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 1.35em;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--jd-shadow);
}
.jd-captcha-title {
    display: block;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--jd-gray-900);
    margin-top: 12px;
}
.jd-captcha-question {
    display: block;
    font-size: 1.15em;
    font-weight: 700;
    color: var(--jd-primary-dark);
    margin: 6px 0 18px;
}
.jd-captcha input[type="number"],
.jd-captcha input[type="text"] {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    padding: 13px 16px;
    border: 1.5px solid var(--jd-gray-200);
    border-radius: 10px;
    font-size: 1.15em;
    font-weight: 700;
    text-align: center;
    color: var(--jd-gray-900);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.jd-captcha input:focus {
    outline: none;
    border-color: var(--jd-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* === Auth Forms === */
.jd-auth-wrapper { max-width: 450px; margin: 40px auto; }
.jd-auth-wrapper .jd-form { max-width: 100%; }
.jd-auth-wrapper .jd-form-section { margin-bottom: 0; }
.jd-auth-header { text-align: center; margin-bottom: 24px; }
.jd-auth-header h2 { margin-bottom: 8px; }
.jd-auth-header p { color: var(--jd-gray-500); }

/* === Venue Registration === */
.jd-map-container {
    width: 100%; height: 300px; border-radius: var(--jd-radius);
    border: 1px solid var(--jd-gray-300); margin-top: 8px;
}
.jd-checkbox-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
}
.jd-checkbox-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    border: 1px solid var(--jd-gray-200); border-radius: 6px;
    cursor: pointer; font-size: 0.9em; transition: background 0.2s;
}
.jd-checkbox-item:hover { background: var(--jd-gray-50); }
.jd-checkbox-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--jd-primary); }
.jd-time-range {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.jd-time-range input[type="time"] {
    padding: 8px 10px; border: 1px solid var(--jd-gray-300);
    border-radius: 6px; font-size: 0.9em; min-width: 0; max-width: 140px;
    box-sizing: border-box;
}
.jd-time-range span { color: var(--jd-gray-500); font-size: 0.9em; }

/* === Multi-space venue form === */
.jd-space-item {
    border: 1px solid var(--jd-gray-200); border-radius: var(--jd-radius);
    padding: 16px; margin-bottom: 16px; background: var(--jd-gray-50);
}
.jd-space-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--jd-gray-200);
}
.jd-space-number { font-weight: 700; color: var(--jd-primary); }

/* === File input === */
.jd-file-input {
    width: 100%; padding: 10px; border: 2px dashed var(--jd-gray-300);
    border-radius: 6px; background: var(--jd-gray-50); cursor: pointer;
}
.jd-file-input:hover { border-color: var(--jd-primary); }

/* ─── Booking Schedule Grid ─── */
.jd-booking-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.jd-booking-header h3 {
    margin: 0;
}
.jd-booking-space-info {
    background: #f0f4ff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1em;
}
.jd-btn-secondary {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
.jd-btn-secondary:hover {
    background: #cbd5e1;
}

/* Schedule Legend */
.jd-schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 8px;
}
.jd-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #475569;
}
.jd-slot-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
}
.jd-slot-indicator.jd-slot-free { background: #22c55e; }
.jd-slot-indicator.jd-slot-pending { background: #f59e0b; }
.jd-slot-indicator.jd-slot-booked { background: #ef4444; }
.jd-slot-indicator.jd-slot-peak { background: #22c55e; border: 2px solid #f59e0b; }

/* Slots Grid */
.jd-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.jd-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 60px;
}
.jd-slot-time {
    font-size: 0.9em;
}
.jd-slot-badge {
    font-size: 0.7em;
    margin-top: 4px;
    opacity: 0.8;
}

/* Free slot */
.jd-slot-free {
    background: #dcfce7;
    border: 2px solid #86efac;
    color: #166534;
    cursor: pointer;
}
.jd-slot-free:hover {
    background: #bbf7d0;
    border-color: #4ade80;
    transform: scale(1.03);
}

/* Peak slot (free but peak hours) */
.jd-slot-peak {
    background: #fef3c7;
    border: 2px solid #fcd34d;
    color: #92400e;
    cursor: pointer;
}
.jd-slot-peak:hover {
    background: #fde68a;
    border-color: #f59e0b;
    transform: scale(1.03);
}

/* Booked slot */
.jd-slot-booked {
    background: #fee2e2;
    border: 2px solid #fca5a5;
    color: #991b1b;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Pending slot */
.jd-slot-pending {
    background: #fff7ed;
    border: 2px solid #fdba74;
    color: #9a3412;
    cursor: not-allowed;
    opacity: 0.85;
}

/* Selected slot */
.jd-slot-selected {
    background: var(--jd-primary-dark) !important;
    border-color: var(--jd-primary-strong) !important;
    color: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}
.jd-slot-selected .jd-slot-badge {
    color: #bfdbfe;
}

/* Selected slot info */
.jd-selected-slot-info {
    background: var(--jd-primary-soft);
    border: 1px solid #bfdbfe;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    color: var(--jd-primary-strong);
}

/* Loading */
.jd-loading {
    text-align: center;
    padding: 30px;
    color: #64748b;
}

/* Responsive */
@media (max-width: 600px) {
    .jd-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .jd-booking-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .jd-schedule-legend {
        gap: 10px;
    }
}

/* ─── Venue Dashboard Panel ─── */
.jd-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
}
.jd-panel-header {
    background: #1e293b;
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.jd-panel-title {
    font-size: 1.1em;
    font-weight: 600;
}
.jd-panel-tab-label { font-weight: 400; opacity: 0.8; }
.jd-panel-user { font-size: 0.9em; opacity: 0.9; }
.jd-panel-tabs {
    display: flex;
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    padding: 0 16px;
}
.jd-panel-tab {
    padding: 12px 16px;
    text-decoration: none;
    color: #64748b;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.jd-panel-tab:hover { color: var(--jd-primary-dark); background: var(--jd-primary-soft); }
.jd-panel-tab.active { color: var(--jd-primary-dark); border-bottom-color: var(--jd-primary-dark); background: #fff; font-weight: 600; }
.jd-panel-body { padding: 24px; }
.jd-panel-section { margin-bottom: 28px; }
.jd-panel-section h3 { margin-bottom: 14px; font-size: 1.1em; }

/* Mi Cuenta: selector de rol entre paneles */
.jd-account-wrap { margin: 20px auto; }
.jd-account-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.jd-account-tab {
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #475569;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.jd-account-tab:hover { color: var(--jd-primary-dark); border-color: var(--jd-primary); }
.jd-account-tab.is-active {
    background: var(--jd-primary-dark);
    color: #fff;
    border-color: var(--jd-primary-dark);
    font-weight: 600;
}

/* Registro unificado: enlace para cambiar de rol */
.jd-reg-form-active { margin-top: 18px; padding-top: 18px; border-top: 1px dashed #cbd5e1; }
.jd-reg-back { font-size: 0.85em; color: var(--jd-primary-dark); text-decoration: none; }

/* === Registro de Patrocinador === */
.jd-sponsor-reg { max-width: 860px; margin: 0 auto; }
.jd-sponsor-reg-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 44px 32px 38px;
    margin-bottom: 26px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 55%, #7c3aed 100%);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
}
.jd-sponsor-reg-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.20) 0, transparent 42%),
        radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.14) 0, transparent 36%);
}
.jd-sponsor-reg-hero > * { position: relative; z-index: 1; }
.jd-sponsor-reg-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.72em;
    letter-spacing: 0.14em;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.jd-sponsor-reg-hero h2 { margin: 0 0 10px; font-size: 1.85em; color: #fff; line-height: 1.2; }
.jd-sponsor-reg-hero p { margin: 0 auto 20px; max-width: 540px; color: rgba(255, 255, 255, 0.88); font-size: 0.95em; }
.jd-sponsor-reg-benefits { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.jd-sponsor-reg-benefits span {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
}

.jd-sponsor-reg-form { display: flex; flex-direction: column; gap: 18px; }
.jd-sponsor-reg-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 24px 8px;
    box-shadow: var(--jd-shadow);
}
.jd-sponsor-reg-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.jd-sponsor-reg-ico {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35em;
    background: linear-gradient(135deg, var(--jd-primary-soft), var(--jd-primary-soft-2));
    border-radius: 12px;
}
.jd-sponsor-reg-section-head h3 { margin: 0; font-size: 1.05em; color: var(--jd-gray-900); }
.jd-sponsor-reg-section-head p { margin: 2px 0 0; font-size: 0.8em; color: var(--jd-gray-500); }

.jd-sponsor-reg-form .jd-form-row { margin-bottom: 16px; }
.jd-sponsor-reg-form label { font-weight: 600; font-size: 0.85em; color: var(--jd-gray-700); }
.jd-sponsor-reg-form input[type="text"],
.jd-sponsor-reg-form input[type="email"],
.jd-sponsor-reg-form input[type="tel"],
.jd-sponsor-reg-form input[type="url"],
.jd-sponsor-reg-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--jd-gray-200);
    border-radius: 10px;
    font-size: 0.92em;
    color: var(--jd-gray-900);
    background: var(--jd-gray-50);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.jd-sponsor-reg-form input:focus,
.jd-sponsor-reg-form select:focus {
    outline: none;
    border-color: var(--jd-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.jd-sponsor-reg-upload {
    display: block;
    cursor: pointer;
    text-align: center;
    border: 2px dashed var(--jd-gray-300);
    border-radius: 14px;
    padding: 30px 20px;
    background: var(--jd-gray-50);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.jd-sponsor-reg-upload:hover { border-color: var(--jd-primary); background: var(--jd-primary-soft); }
.jd-sponsor-reg-upload-ico { font-size: 2.4em; display: block; margin-bottom: 10px; }
.jd-sponsor-reg-upload-title { font-weight: 700; color: var(--jd-gray-900); display: block; }
.jd-sponsor-reg-upload-sub { color: var(--jd-gray-500); font-size: 0.82em; display: block; margin-top: 5px; }
.jd-sponsor-reg-upload.has-file {
    border-color: var(--jd-success);
    border-style: solid;
    background: #f0fdf4;
}
.jd-sponsor-reg-upload.has-file .jd-sponsor-reg-upload-ico { color: var(--jd-success); }
.jd-sponsor-reg-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: center;
    max-width: 400px;
    width: 100%;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.jd-sponsor-reg-submit:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 14px 28px rgba(22, 163, 74, 0.42); }
.jd-sponsor-reg-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.jd-sponsor-reg-msg {
    display: none;
    padding: 14px 16px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    font-size: 0.9em;
}
.jd-sponsor-reg-msg.jd-msg-success { display: block; background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.jd-sponsor-reg-msg.jd-msg-error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

@media (max-width: 600px) {
    .jd-sponsor-reg-hero { padding: 30px 18px 26px; }
    .jd-sponsor-reg-hero h2 { font-size: 1.4em; }
    .jd-sponsor-reg-section { padding: 18px 18px 4px; }
    .jd-sponsor-reg-section-head { flex-wrap: wrap; }
}

/* Metrics */
.jd-panel-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.jd-metric {
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.jd-metric-value { font-size: 1.6em; font-weight: 700; }
.jd-metric-label { font-size: 0.75em; margin-top: 4px; opacity: 0.85; }
.jd-metric-green { background: #dcfce7; color: #166534; }
.jd-metric-blue { background: var(--jd-primary-soft-2); color: var(--jd-primary-strong); }
.jd-metric-purple { background: #f3e8ff; color: #6b21a8; }
.jd-metric-orange { background: #ffedd5; color: #9a3412; }
.jd-metric-pink { background: #fce7f3; color: #9d174d; }
.jd-metric-teal { background: #ccfbf1; color: #115e59; }

/* Zone cards */
.jd-zone-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.jd-zone-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 160px;
}
.jd-zone-card strong { display: block; margin-bottom: 4px; }
.jd-zone-meta { font-size: 0.8em; color: #64748b; }
.jd-muted { color: #94a3b8; font-style: italic; }

/* Income */
.jd-income-display { background: #f0fdf4; border-radius: 8px; padding: 16px 20px; display: inline-block; }
.jd-income-amount { font-size: 1.8em; font-weight: 700; color: #166534; }
.jd-income-label { display: block; font-size: 0.8em; color: #64748b; margin-top: 4px; }

/* Table */
.jd-table-responsive { overflow-x: auto; }
.jd-panel-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.jd-panel-table th { background: #f1f5f9; padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; }
.jd-panel-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.jd-panel-table tbody tr:hover { background: #f8fafc; }

@media (max-width: 768px) {
    .jd-panel-header { flex-direction: column; gap: 8px; text-align: center; }
    .jd-panel-metrics { grid-template-columns: repeat(3, 1fr); }
    .jd-panel-tabs { padding: 0 8px; }
    .jd-panel-tab { padding: 10px 10px; font-size: 0.78em; }
    .jd-panel-body { padding: 16px; }
}

/* ─── Venue Management Cards ─── */
.jd-venue-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.jd-venue-mgmt-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    position: relative;
    transition: box-shadow 0.2s;
}
.jd-venue-mgmt-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.jd-venue-card-active { border-left: 4px solid #22c55e; }
.jd-venue-card-pending { border-left: 4px solid #f59e0b; opacity: 0.85; }
.jd-venue-mgmt-status { margin-bottom: 8px; }
.jd-badge { padding: 3px 10px; border-radius: 12px; font-size: 0.75em; font-weight: 600; }
.jd-badge-green { background: #dcfce7; color: #166534; }
.jd-badge-orange { background: #ffedd5; color: #9a3412; }
.jd-venue-mgmt-name { margin: 0 0 8px; font-size: 1.1em; }
.jd-venue-mgmt-details { display: flex; flex-direction: column; gap: 4px; font-size: 0.85em; color: #64748b; margin-bottom: 12px; }
.jd-venue-mgmt-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Add button */
.jd-add-venue-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    color: #64748b;
    transition: all 0.2s;
}
.jd-add-venue-btn:hover { border-color: var(--jd-primary-dark); color: var(--jd-primary-dark); background: var(--jd-primary-soft); }
.jd-add-icon { font-size: 2em; font-weight: 300; line-height: 1; }

/* Form card */
.jd-form-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
}
.jd-form-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.jd-form-card-header h3 { margin: 0; }

@media (max-width: 600px) {
    .jd-venue-cards-grid { grid-template-columns: 1fr; }
    .jd-venue-mgmt-actions { flex-direction: column; }
}

/* ─── Venues Public Page (Deportistas) ─── */
.jd-venues-page { max-width: 1180px; margin: 0 auto; }

/* Hero */
.jd-venues-hero {
    position: relative;
    text-align: center;
    padding: 40px 24px 34px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #164e63 100%);
    border-radius: 18px;
    color: #fff;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.25);
}
.jd-venues-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(59,130,246,0.35) 0, transparent 40%),
        radial-gradient(circle at 88% 80%, rgba(16,185,129,0.25) 0, transparent 40%);
    pointer-events: none;
}
.jd-venues-hero h2 { position: relative; margin: 0 0 8px; font-size: 1.8em; color: #fff; letter-spacing: -0.3px; }
.jd-venues-hero p { position: relative; margin: 0 0 22px; opacity: 0.85; font-size: 0.98em; }

/* Sport filter chips */
.jd-sport-filter {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.jd-sport-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s;
}
.jd-sport-chip:hover { background: rgba(255,255,255,0.2); color: #fff; transform: translateY(-1px); }
.jd-sport-chip.active { background: var(--jd-primary); border-color: var(--jd-primary); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(59,130,246,0.4); }

/* Map */
.jd-venues-map-section { margin-bottom: 24px; }
.jd-map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 460px;
    margin: 0 auto 8px;
    padding: 14px 20px;
    font-size: 0.98em;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--jd-primary) 0%, var(--jd-primary-dark) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transition: all 0.25s;
}
.jd-map-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45); }
.jd-map-btn.active { background: linear-gradient(135deg, #334155 0%, #1e293b 100%); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.3); }
.jd-map-btn-icon { font-size: 1.25em; }
.jd-venues-map-inner { margin-top: 12px; }
.jd-venues-map {
    height: 430px;
    border-radius: 14px;
    z-index: 1;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    background: #e8edf2;
}
.jd-map-legend { margin: 8px 0 0; text-align: center; color: #64748b; font-size: 0.82em; }

/* Filtro de distancia del mapa */
.jd-map-filter {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px 14px;
    margin-bottom: 12px;
}
.jd-map-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #334155;
}
.jd-map-filter-row label { font-weight: 600; }
.jd-map-filter-row strong { color: var(--jd-primary); font-size: 1em; }
.jd-map-filter input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(to right, var(--jd-primary-mid) 0%, var(--jd-primary) 100%);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
}
.jd-map-filter input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--jd-primary);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    cursor: pointer;
}
.jd-map-filter input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--jd-primary);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    cursor: pointer;
}
.jd-map-filter-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.72em;
    color: #94a3b8;
    margin-top: 4px;
}
.jd-map-filter-count {
    margin-top: 8px;
    font-size: 0.82em;
    font-weight: 600;
    color: #16a34a;
}
.jd-map-noloc {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85em;
    margin-bottom: 12px;
    text-align: center;
}

/* Leaflet popup (mapa de canchas) */
.jd-map-pop { min-width: 200px; max-width: 250px; }
.jd-map-pop-img { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.jd-map-pop-body { line-height: 1.35; }
.jd-map-pop-title { display: block; font-size: 0.98em; margin-bottom: 2px; }
.jd-map-pop-addr { font-size: 0.8em; color: #64748b; margin-bottom: 6px; }
.jd-map-pop-price { font-size: 1.05em; font-weight: 700; color: #16a34a; }
.jd-map-pop-price span { font-size: 0.7em; font-weight: 500; color: #94a3b8; margin-left: 2px; }
.jd-map-pop-dist { font-size: 0.78em; color: #7c3aed; margin-top: 2px; }
.jd-map-pop-link { display: inline-block; margin-top: 8px; font-size: 0.85em; font-weight: 600; color: var(--jd-primary); text-decoration: none; }
.jd-map-pop-link:hover { text-decoration: underline; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 8px 24px rgba(15,23,42,0.18); }

/* Marcador de ubicación del usuario */
.jd-map-user-icon span {
    display: block;
    width: 22px;
    height: 22px;
    background: var(--jd-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
    animation: jd-map-pulse 1.8s infinite;
}
@keyframes jd-map-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5), 0 0 0 4px rgba(37, 99, 235, 0.25); }
    70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0), 0 0 0 6px rgba(37, 99, 235, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 0 0 4px rgba(37, 99, 235, 0.25); }
}

/* Count */
.jd-venues-count { margin-bottom: 16px; color: #64748b; font-size: 0.9em; font-weight: 500; }

/* Cards grid */
.jd-venues-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

/* Card */
.jd-venue-card-pro {
    display: block;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    border: 1px solid #f1f5f9;
}
.jd-venue-card-pro:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    border-color: var(--jd-primary);
}

/* Card image */
.jd-vpc-image {
    position: relative;
    height: 185px;
    overflow: hidden;
    background: #e2e8f0;
}
.jd-vpc-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.jd-venue-card-pro:hover .jd-vpc-image img { transform: scale(1.06); }
.jd-vpc-no-image { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 3em; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }
.jd-vpc-price {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    line-height: 1.2;
}
.jd-vpc-price strong { font-size: 0.92em; font-weight: 700; }
.jd-vpc-price small { font-size: 0.66em; color: #a5f3fc; font-weight: 500; }

/* Card body */
.jd-vpc-body { padding: 16px; }
.jd-vpc-title { margin: 0 0 6px; font-size: 1.12em; color: #0f172a; }
.jd-vpc-address { margin: 0 0 10px; font-size: 0.85em; color: #64748b; }

/* Tags */
.jd-vpc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.jd-vpc-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--jd-primary-soft);
    color: var(--jd-primary-dark);
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

/* Footer */
.jd-vpc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.jd-vpc-teams { font-size: 0.8em; color: #64748b; }
.jd-vpc-services { display: flex; gap: 4px; font-size: 1em; }

@media (max-width: 900px) {
    .jd-venues-page { padding: 0 14px; }
}

@media (max-width: 768px) {
    .jd-venues-grid-pro { grid-template-columns: 1fr; gap: 18px; }
    .jd-venues-hero { padding: 26px 16px; border-radius: 14px; }
    .jd-venues-hero h2 { font-size: 1.35em; }
    .jd-venues-hero p { font-size: 0.9em; margin-bottom: 18px; }
    .jd-map-btn {
        max-width: none;
        min-height: 50px;
        padding: 12px 16px;
        font-size: 0.95em;
    }
    .jd-map-btn-icon { font-size: 1.1em; }
    .jd-venues-map { height: 340px; border-radius: 12px; }
    .jd-map-filter { padding: 12px 14px; }
    .jd-map-filter-row { font-size: 0.85em; }
    .jd-map-filter input[type="range"] { height: 8px; }
    .jd-map-filter input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; }
    .jd-map-filter input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; }
    .jd-vpc-image { height: 160px; }
    .jd-vpc-body { padding: 14px; }
    .jd-vpc-footer { flex-wrap: wrap; gap: 8px; }
    .jd-vpc-title { font-size: 1.05em; }
    .jd-venues-count { font-size: 0.85em; }
}

@media (max-width: 600px) {
    .jd-venues-map { height: 300px; }
    .jd-venues-filters { padding: 14px 14px; }
    .jd-filter-item select { padding: 11px 12px; font-size: 0.9em; }
    .jd-map-pop { min-width: 170px; max-width: 240px; }
    .leaflet-popup-content { width: auto !important; }
    .jd-map-pop-img { height: 80px; }
}

@media (max-width: 420px) {
    .jd-venues-hero { padding: 22px 12px; }
    .jd-venues-hero h2 { font-size: 1.2em; }
    .jd-map-pop { min-width: 150px; max-width: 210px; }
    .jd-vpc-image { height: 140px; }
}

/* ─── Schedule Days ─── */
.jd-schedule-days {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.jd-schedule-day-row {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.jd-schedule-day-row.jd-day-closed {
    background: #fef2f2;
    border-color: #fecaca;
    opacity: 0.7;
}
.jd-schedule-day-row.jd-day-closed .jd-day-times {
    opacity: 0.4;
    pointer-events: none;
}
.jd-day-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}
.jd-day-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
}
.jd-day-name { font-size: 0.9em; }
.jd-day-times {
    display: flex;
    align-items: center;
    gap: 8px;
}
.jd-day-time-input {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85em;
    width: 110px;
}
.jd-day-separator { color: #94a3b8; font-size: 0.85em; }
.jd-day-status { font-size: 0.8em; white-space: nowrap; }

@media (max-width: 768px) {
    .jd-schedule-day-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .jd-day-times { justify-content: flex-start; }
}

/* ─── Photo Upload Component ─── */
.jd-photo-upload-box { max-width: 320px; }
.jd-photo-upload-box.jd-photo-small { max-width: 160px; }
.jd-file-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.jd-photo-preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    display: inline-block;
}
.jd-photo-preview img {
    display: block;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
}
.jd-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px 12px 12px;
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.jd-photo-preview:hover .jd-photo-overlay { opacity: 1; }
.jd-photo-change-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    color: #1e293b;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.jd-photo-change-btn:hover { background: #f1f5f9; }

.jd-photo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 24px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    color: #64748b;
    transition: all 0.2s;
}
.jd-photo-empty:hover { border-color: var(--jd-primary); background: var(--jd-primary-soft); color: var(--jd-primary-dark); }
.jd-photo-empty-icon { font-size: 2em; }
.jd-photo-empty small { font-size: 0.75em; opacity: 0.7; }
.jd-photo-empty-sm { padding: 16px 12px; }
.jd-photo-empty-sm .jd-photo-empty-icon { display: none; }

/* ─── Venues Advanced Filters ─── */
.jd-venues-filters {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.jd-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}
.jd-filter-item label {
    display: block;
    font-size: 0.78em;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.jd-filter-item select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85em;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s;
}
.jd-filter-item select:focus { border-color: var(--jd-primary); outline: none; }
.jd-venue-card-pro.jd-hidden { display: none !important; }

@media (max-width: 600px) {
    .jd-filter-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
    .jd-filter-row { grid-template-columns: 1fr; }
    .jd-venues-filters { padding: 12px; }
}

/* ── Venue Selector Filters ──────────────────────────────────── */
.jd-vf-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.jd-vf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 560px) {
    .jd-vf-grid { grid-template-columns: repeat(3, 1fr); }
}

.jd-vf-item { display: flex; flex-direction: column; }

.jd-vf-label {
    font-size: 0.76em;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jd-vf-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85em;
    background: #fff;
    color: #1e293b;
}

.jd-vf-input:focus {
    outline: none;
    border-color: var(--jd-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.jd-vf-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.jd-vf-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82em;
    white-space: nowrap;
}

.jd-vf-btn-blue  { background: var(--jd-primary); color: #fff; }
.jd-vf-btn-blue:hover { background: var(--jd-primary-dark); }
.jd-vf-btn-gray  { background: #e2e8f0; color: #475569; }
.jd-vf-btn-gray:hover { background: #cbd5e1; }

/* Mapa */
.jd-vf-map {
    height: 260px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.jd-vf-map-loader {
    position: absolute;
    inset: 0;
    background: rgba(248,250,252,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.9em;
    color: #64748b;
    pointer-events: none;
}

/* Badges en cards */
.jd-vf-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.72em;
    font-weight: 600;
    white-space: nowrap;
}

.jd-vf-badge-blue  { background: var(--jd-primary-soft-2); color: var(--jd-primary-dark); }
.jd-vf-badge-green { background: #dcfce7; color: #15803d; }

/* Cards de complejo */
#jd-venue-list .jd-venue-option {
    transition: border-color .15s, box-shadow .15s;
}

#jd-venue-list .jd-venue-option:hover {
    border-color: var(--jd-primary-mid);
    box-shadow: 0 2px 8px rgba(37,99,235,.1);
}

.jd-venue-option-address {
    display: block;
    font-size: .81em;
    color: #64748b;
    margin-top: 2px;
}

/* ─── Team Dashboard ─── */
.jd-team-dashboard .jd-td-logo-section {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}
.jd-td-logo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.jd-td-logo-preview {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}
.jd-td-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.jd-td-logo-empty {
    font-size: 2.5em;
    color: #94a3b8;
    text-align: center;
    line-height: 1.2;
}
.jd-td-logo-empty small {
    font-size: 0.35em;
    display: block;
}
.jd-td-logo-btn {
    font-size: 0.9em;
}

/* Team Dashboard - Members List */
.jd-td-members-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.jd-td-member-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.jd-td-member-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.jd-td-member-photo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jd-td-member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.jd-td-member-no-photo {
    font-size: 1.6em;
    color: #94a3b8;
}
.jd-td-member-info {
    flex: 1;
    min-width: 0;
}
.jd-td-member-name {
    font-size: 1em;
    color: #1e293b;
}
.jd-td-member-jersey {
    display: inline-block;
    background: var(--jd-primary-soft);
    color: var(--jd-primary);
    font-size: 0.8em;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: 6px;
}
.jd-td-member-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    color: #64748b;
    margin-top: 4px;
    flex-wrap: wrap;
}
.jd-td-member-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Team Dashboard - Empty state */
.jd-td-empty {
    text-align: center;
    padding: 32px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
}
.jd-td-empty p {
    margin: 4px 0;
}

/* Team Dashboard - Edit modal overlay */
#jd-td-edit-wrapper {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#jd-td-edit-wrapper .jd-form-card {
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .jd-td-member-card {
        flex-wrap: wrap;
    }
    .jd-td-member-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    .jd-td-logo-preview {
        width: 100px;
        height: 100px;
    }
}

/* Team Dashboard - Header con Logo + Portada */
.jd-td-header {
    display: flex;
    gap: 20px;
    align-items: stretch;
    min-height: 180px;
}
.jd-td-logo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 130px;
}
.jd-td-cover-col {
    flex: 1;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    min-height: 180px;
}
.jd-td-cover-preview {
    width: 100%;
    height: 100%;
    min-height: 180px;
}
.jd-td-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.jd-td-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
    color: #94a3b8;
    font-size: 1.1em;
    cursor: pointer;
}
.jd-td-header-section {
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
@media (max-width: 600px) {
    .jd-td-header {
        flex-direction: column;
        align-items: center;
    }
    .jd-td-logo-col { width: 100px; }
    .jd-td-cover-col { width: 100%; min-height: 140px; }
    .jd-td-cover-preview { min-height: 140px; }
}

/* ═══ TORRES DE HONOR ═══ */
.jd-towers-page { max-width: 1200px; margin: 0 auto; }
.jd-towers-header { text-align: center; margin-bottom: 30px; }
.jd-towers-header h2 { font-size: 1.8em; margin-bottom: 6px; }
.jd-towers-header p { color: #64748b; }

.jd-towers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    align-items: flex-end;
}

.jd-tower {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.jd-tower-roof {
    width: 60px;
    height: 40px;
    background: var(--tower-color);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 15px var(--tower-glow);
}
.jd-tower-roof-icon {
    font-size: 1.3em;
    position: absolute;
    top: 12px;
}

.jd-tower-name {
    font-size: 0.8em;
    font-weight: 700;
    color: var(--tower-color);
    margin: 4px 0 2px;
    text-align: center;
}
.jd-tower-range {
    font-size: 0.65em;
    color: #94a3b8;
    margin-bottom: 6px;
}

.jd-tower-body {
    width: 100%;
    border-radius: 4px 4px 0 0;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.3), inset 0 0 30px rgba(0,0,0,0.2);
}

.jd-tower-floor {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 38px;
    position: relative;
    transition: background 0.3s;
}
.jd-tower-floor:hover {
    background: rgba(255,255,255,0.05);
}

.jd-floor-number {
    font-size: 0.65em;
    color: rgba(255,255,255,0.3);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.jd-floor-teams {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.jd-tower-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    animation: jd-tower-glow 2s ease-in-out infinite alternate;
}
.jd-tower-team img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tower-glow);
    box-shadow: 0 0 8px var(--tower-glow);
}
.jd-tower-team-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    border: 2px solid var(--tower-glow);
}
.jd-tower-team-name {
    font-size: 0.55em;
    color: #fff;
    text-align: center;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.jd-tower-team-elo {
    font-size: 0.5em;
    color: var(--tower-glow);
    font-weight: 700;
}

.jd-tower-base {
    padding: 6px;
    text-align: center;
    background: rgba(0,0,0,0.4);
    font-size: 0.7em;
    color: rgba(255,255,255,0.5);
    border-top: 2px solid var(--tower-color);
}

@keyframes jd-tower-glow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

/* Leyenda */
.jd-towers-legend {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.jd-towers-legend h3 { margin: 0 0 12px; }
.jd-towers-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.jd-towers-legend-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.jd-legend-icon { font-size: 1.5em; }
.jd-towers-legend-item p { margin: 2px 0 0; font-size: 0.85em; color: #64748b; }

/* Responsive */
@media (max-width: 900px) {
    .jd-towers-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .jd-towers-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .jd-tower-team img { width: 22px; height: 22px; }
    .jd-tower-floor { padding: 4px 6px; min-height: 32px; }
}

/* ═══ MARKETPLACE DE EQUIPOS ═══ */
.jd-marketplace-header { text-align: center; margin-bottom: 24px; }
.jd-marketplace-header h2 { font-size: 1.6em; margin-bottom: 4px; }
.jd-marketplace-header p { color: #64748b; }
.jd-marketplace-filters { margin-bottom: 20px; }

.jd-marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.jd-mk-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.jd-mk-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.jd-mk-cover {
    height: 100px;
    background-size: cover;
    background-position: center;
    background-color: #1e293b;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px;
}
.jd-mk-tier-badge {
    color: #fff;
    font-size: 0.7em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}
.jd-mk-value-badge {
    background: rgba(0,0,0,0.7);
    color: #4ade80;
    font-size: 0.85em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.jd-mk-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    margin: -25px auto 0;
    position: relative;
    z-index: 2;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.jd-mk-logo img { width: 100%; height: 100%; object-fit: cover; }
.jd-mk-logo span { font-size: 1.5em; }

.jd-mk-info { padding: 10px 16px 16px; text-align: center; }
.jd-mk-name { font-size: 1em; margin: 6px 0 4px; }
.jd-mk-meta { font-size: 0.8em; color: #64748b; display: flex; gap: 10px; justify-content: center; }

.jd-mk-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 12px 0;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}
.jd-mk-stat { text-align: center; }
.jd-mk-stat-val { display: block; font-size: 0.95em; font-weight: 700; color: #1e293b; }
.jd-mk-stat-label { font-size: 0.65em; color: #94a3b8; text-transform: uppercase; }

.jd-mk-actions { display: flex; gap: 6px; justify-content: center; }

@media (max-width: 600px) {
    .jd-marketplace-grid { grid-template-columns: 1fr; }
}

/* Tower VCE badge */
.jd-tower-team-vce {
    font-size: 0.45em;
    color: #4ade80;
    font-weight: 600;
    background: rgba(0,0,0,0.3);
    padding: 1px 4px;
    border-radius: 3px;
}

/* ═══ VENUE PUBLIC PAGE TABS ═══ */
.jd-vp-tabbed { max-width: 100%; }
.jd-vp-hero {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}
.jd-vp-title-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}
.jd-vp-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.jd-vp-title { font-size: 1.5em; margin: 0; color: #1e293b; }
.jd-vp-meta { display: flex; gap: 12px; flex-wrap: wrap; color: #64748b; font-size: 0.85em; margin-top: 4px; }

.jd-vp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    margin-top: 16px;
}
.jd-vp-tab {
    padding: 10px 18px;
    font-size: 0.9em;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.jd-vp-tab:hover { color: #1e293b; }
.jd-vp-tab.active { color: var(--jd-primary); border-color: var(--jd-primary); font-weight: 600; }

.jd-vp-body { padding: 20px 0; }
.jd-vp-description { font-size: 1em; color: #374151; line-height: 1.6; margin-bottom: 20px; }

.jd-vp-info-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.jd-vp-icard { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; text-align: center; }
.jd-vp-icard span { font-size: 1.5em; display: block; margin-bottom: 4px; }
.jd-vp-icard strong { display: block; font-size: 1em; }
.jd-vp-icard small { color: #64748b; font-size: 0.8em; }

.jd-vp-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.jd-vp-badge { background: var(--jd-primary-soft); color: var(--jd-primary-strong); padding: 6px 12px; border-radius: 6px; font-size: 0.85em; }
.jd-vp-schedule { display: flex; flex-direction: column; gap: 6px; font-size: 0.95em; margin-bottom: 20px; }

.jd-vp-spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.jd-vp-space { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; transition: box-shadow 0.2s; }
.jd-vp-space:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.jd-vp-space-body { padding: 14px; }
.jd-vp-space-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.85em; color: #64748b; margin: 6px 0; }
.jd-vp-space-price { font-size: 0.95em; margin-top: 8px; }
.jd-vp-space-price span { display: block; color: #f59e0b; font-size: 0.85em; }

.jd-vp-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.jd-vp-team-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none; color: inherit; transition: border-color 0.2s; }
.jd-vp-team-card:hover { border-color: var(--jd-primary); }
.jd-vp-team-logo { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #f1f5f9; }
.jd-vp-team-logo img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 600px) {
    .jd-vp-info-cards { grid-template-columns: repeat(2, 1fr); }
    .jd-vp-hero { height: 160px; }
    .jd-vp-title { font-size: 1.2em; }
    .jd-vp-logo { width: 50px; height: 50px; }
}

/* Ocultar título, thumbnail y metadata del tema en páginas de venue */
body.single-jd_venue .entry-header,
body.single-jd_venue .entry-title,
body.single-jd_venue .entry-meta,
body.single-jd_venue .post-thumbnail,
body.single-jd_venue .wp-post-image,
body.single-jd_venue .page-title,
body.single-jd_venue .byline,
body.single-jd_venue .posted-on,
body.single-jd_venue .cat-links,
body.single-jd_venue article > header,
body.single-jd_venue .site-content > article > header,
body.single-jd_venue .hentry > header,
body.single-jd_venue .type-jd_venue > header {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    line-height: 0 !important;
    font-size: 0 !important;
    border: none !important;
}

/* ═══ PLAYER CARD - Estilo FIFA/Profesional ═══ */
.jd-player-card {
    width: 200px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--pc-color, #1e293b) 0%, #0f172a 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}
.jd-player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.jd-pc-header {
    position: relative;
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.jd-pc-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}
.jd-pc-no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    font-size: 3em;
    color: rgba(255,255,255,0.3);
}

.jd-pc-number {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 2em;
    font-weight: 900;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1;
}

.jd-pc-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.jd-pc-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jd-pc-info {
    padding: 10px 12px 14px;
    text-align: center;
}
.jd-pc-name {
    font-size: 0.85em;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jd-pc-position {
    font-size: 0.7em;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.jd-pc-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.jd-pc-stat {
    text-align: center;
}
.jd-pc-stat-val {
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    display: block;
}
.jd-pc-stat-lbl {
    font-size: 0.55em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

/* Grid de cards de jugadores */
.jd-players-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

@media (max-width: 600px) {
    .jd-player-card { width: 160px; }
    .jd-pc-header { height: 150px; }
    .jd-pc-number { font-size: 1.5em; }
}

/* ═══ TEAM LINEUP (Portada generada automática) ═══ */
.jd-lineup {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(180deg, #1a3a5c 0%, #0d2137 100%);
    border-radius: 10px;
    overflow: hidden;
}
.jd-lineup-field {
    position: absolute;
    inset: 10px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
}
.jd-lineup-field::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
}
.jd-lineup-field::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
}
.jd-lineup-title {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
}
.jd-lineup-player {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transform: translateX(-50%);
}
.jd-lineup-player-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    background: #1e293b;
}
.jd-lineup-player-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.jd-lineup-player-img span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.9em;
    color: rgba(255,255,255,0.5);
}
.jd-lineup-player-name {
    font-size: 0.55em;
    color: #fff;
    font-weight: 600;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.jd-lineup-player-num {
    font-size: 0.5em;
    color: rgba(255,255,255,0.6);
}

/* ═══ TEAM PUBLIC PAGE ═══ */
.jd-team-public { max-width: 100%; }
.jd-tp-hero {
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
}
.jd-tp-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.jd-tp-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e2e8f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.jd-tp-logo img { width: 100%; height: 100%; object-fit: cover; }
.jd-tp-logo span { font-size: 2em; }
.jd-tp-info { flex: 1; }
.jd-tp-name { font-size: 1.4em; margin: 0; color: #1e293b; }
.jd-tp-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.85em; color: #64748b; margin-top: 4px; }
.jd-tp-value { text-align: center; }
.jd-tp-value-amount { display: block; font-size: 1.3em; font-weight: 700; color: #16a34a; }
.jd-tp-value-label { font-size: 0.7em; color: #64748b; text-transform: uppercase; }

.jd-tp-stats {
    display: flex;
    gap: 0;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 24px;
}
.jd-tp-stat {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-right: 1px solid #e2e8f0;
}
.jd-tp-stat:last-child { border-right: none; }
.jd-tp-stat-val { display: block; font-size: 1.1em; font-weight: 700; color: #1e293b; }
.jd-tp-stat-lbl { font-size: 0.7em; color: #94a3b8; text-transform: uppercase; }

.jd-tp-section { margin-bottom: 24px; }
.jd-tp-section h2 { font-size: 1.2em; margin-bottom: 16px; }

/* Ocultar header del tema en team pages */
body.single-jd_team .entry-header,
body.single-jd_team .entry-title,
body.single-jd_team .entry-meta,
body.single-jd_team .post-thumbnail,
body.single-jd_team .wp-post-image {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

@media (max-width: 600px) {
    .jd-tp-hero { height: 140px; }
    .jd-tp-header { flex-direction: column; align-items: flex-start; }
    .jd-tp-stats { flex-wrap: wrap; }
    .jd-tp-stat { min-width: 33%; }
}


/* === MEMBRESÍAS === */
.jd-memberships-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}
.jd-memberships-header {
    text-align: center;
    margin-bottom: 32px;
}
.jd-memberships-header h2 {
    font-size: 2em;
    font-weight: 700;
    color: var(--jd-gray-900);
    margin-bottom: 8px;
}
.jd-memberships-header p {
    color: var(--jd-gray-500);
    font-size: 1.05em;
    max-width: 600px;
    margin: 0 auto;
}

/* Plan actual */
.jd-membership-current {
    background: linear-gradient(135deg, var(--jd-primary-soft) 0%, #f0fdf4 100%);
    border: 1px solid var(--jd-gray-200);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
}
.jd-membership-current h3 {
    font-size: 1.1em;
    margin: 0 0 12px;
    color: var(--jd-gray-700);
}
.jd-membership-team-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-bottom: 1px solid var(--jd-gray-200);
}
.jd-membership-team-status:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.jd-membership-team-status strong {
    font-size: 1em;
    color: var(--jd-gray-900);
}
.jd-membership-badge {
    background: var(--jd-primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}
.jd-membership-remaining {
    color: var(--jd-gray-500);
    font-size: 0.9em;
}
.jd-membership-expires {
    font-size: 0.85em;
    color: var(--jd-gray-500);
    margin-left: auto;
}


/* Grid de planes */
.jd-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Card de plan */
.jd-plan-card {
    background: #fff;
    border: 1px solid var(--jd-gray-200);
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--jd-shadow);
}
.jd-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* Plan destacado */
.jd-plan-featured {
    border: 2px solid var(--jd-primary);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
    transform: scale(1.03);
}
.jd-plan-featured:hover {
    transform: scale(1.03) translateY(-4px);
}
.jd-plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--jd-primary), #7c3aed);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Header del plan */
.jd-plan-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--jd-gray-100);
    width: 100%;
}
.jd-plan-icon {
    font-size: 2.5em;
    display: block;
    margin-bottom: 8px;
}
.jd-plan-name {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--jd-gray-900);
    margin: 0 0 8px;
}
.jd-plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}
.jd-plan-amount {
    font-size: 2em;
    font-weight: 800;
    color: var(--jd-gray-900);
}
.jd-plan-period {
    font-size: 0.9em;
    color: var(--jd-gray-500);
}


/* Descripción del plan */
.jd-plan-description {
    margin-bottom: 16px;
}
.jd-plan-description p {
    color: var(--jd-gray-500);
    font-size: 0.9em;
    margin: 0;
    line-height: 1.5;
}

/* Lista de features */
.jd-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    width: 100%;
    text-align: left;
}
.jd-plan-feature {
    padding: 8px 0;
    border-bottom: 1px solid var(--jd-gray-100);
    font-size: 0.9em;
    color: var(--jd-gray-700);
    display: flex;
    align-items: center;
    gap: 6px;
}
.jd-plan-feature:last-child {
    border-bottom: none;
}
.jd-plan-feature-disabled {
    color: var(--jd-gray-300);
    text-decoration: line-through;
}

/* Botones de plan */
.jd-plan-card .jd-btn {
    width: 100%;
    margin-top: auto;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, transform 0.1s;
}
.jd-plan-card .jd-btn-primary {
    background: var(--jd-primary);
    color: #fff;
}
.jd-plan-card .jd-btn-primary:hover {
    background: var(--jd-primary-dark);
    transform: scale(1.02);
}
.jd-plan-card .jd-btn-disabled {
    background: var(--jd-gray-100);
    color: var(--jd-gray-500);
    cursor: not-allowed;
}

/* FAQ de membresías */
.jd-memberships-faq {
    background: var(--jd-gray-50);
    border: 1px solid var(--jd-gray-200);
    border-radius: 12px;
    padding: 24px;
    margin-top: 40px;
}
.jd-memberships-faq h3 {
    font-size: 1.1em;
    color: var(--jd-gray-900);
    margin: 0 0 12px;
}
.jd-memberships-faq ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.jd-memberships-faq li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--jd-gray-700);
    font-size: 0.9em;
    line-height: 1.5;
    border-bottom: 1px solid var(--jd-gray-100);
}
.jd-memberships-faq li:last-child {
    border-bottom: none;
}
.jd-memberships-faq li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--jd-primary);
    font-weight: 700;
}

/* Formulario de contratación */
#jd-subscribe-form-section .jd-form-section {
    background: #fff;
    border: 1px solid var(--jd-gray-200);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--jd-shadow);
}
#jd-subscribe-form-section h3 {
    margin: 0 0 16px;
    font-size: 1.2em;
    color: var(--jd-gray-900);
}

/* Responsive */
@media (max-width: 768px) {
    .jd-plans-grid {
        grid-template-columns: 1fr;
    }
    .jd-plan-featured {
        transform: none;
    }
    .jd-plan-featured:hover {
        transform: translateY(-4px);
    }
    .jd-membership-team-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .jd-membership-expires {
        margin-left: 0;
    }
}


/* === FORMULARIOS RESPONSIVE === */
.jd-register-wrapper,
.jd-report-match-form,
.jd-pending-matches {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.jd-form input[type="text"],
.jd-form input[type="email"],
.jd-form input[type="tel"],
.jd-form input[type="number"],
.jd-form input[type="password"],
.jd-form select,
.jd-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--jd-gray-200);
    border-radius: 6px;
    font-size: 1em;
}

.jd-form-section {
    background: #fff;
    border: 1px solid var(--jd-gray-200);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--jd-shadow);
    box-sizing: border-box;
}

.jd-form-row {
    margin-bottom: 12px;
}
.jd-form-row label {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 4px;
    color: var(--jd-gray-700);
}

.jd-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .jd-form-grid {
        grid-template-columns: 1fr;
    }
    .jd-form-section {
        padding: 14px;
        margin-bottom: 12px;
    }
    .jd-register-wrapper {
        padding: 0 8px;
    }
    .jd-register-header {
        padding: 0 4px;
    }
    .jd-register-header h2 {
        font-size: 1.3em;
    }
    .jd-btn-large {
        padding: 14px !important;
        font-size: 1em !important;
    }
}

/* Formulario de equipo: bloques apilados */
.jd-register-wrapper [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 600px) {
    .jd-register-wrapper [style*="grid-template-columns: 1fr 1fr"],
    .jd-register-wrapper [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}


/* Fotos grid 3 columnas → 1 en móvil */
@media (max-width: 600px) {
    .jd-form-grid[style*="repeat(3"] {
        grid-template-columns: 1fr !important;
    }
    .jd-upload-icon {
        font-size: 1.2em !important;
    }
}


/* Fix file inputs que se salen en móvil */
.jd-form input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.85em;
    padding: 8px 0;
}

/* Fix para secciones anidadas que se salen */
.jd-form .jd-form-section {
    overflow: hidden;
    word-wrap: break-word;
}

/* Checkbox labels que se salen */
.jd-checkbox-item {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85em;
    line-height: 1.4;
    word-wrap: break-word;
}
.jd-checkbox-item input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px;
    width: 16px;
    height: 16px;
}

/* Captcha input no se sale */
.jd-form input[type="number"] {
    max-width: 100%;
}

/* Form card responsive */
.jd-form-card {
    padding: 16px;
    overflow: hidden;
}
@media (max-width: 600px) {
    .jd-form-card {
        padding: 12px;
    }
    .jd-form-card-header {
        flex-direction: column;
        gap: 8px;
    }
    .jd-form-card-header h3 {
        font-size: 1em;
    }
}

/* Help text */
.jd-form-help {
    display: block;
    font-size: 0.75em;
    color: #94a3b8;
    margin-top: 4px;
}


/* Fix file inputs overflow en grids */
.jd-form-row {
    overflow: hidden;
}
.jd-form input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.8em;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 600px) {
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ─── Toggle mostrar/ocultar contraseña ─── */
.jd-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.jd-password-wrapper input[type="password"],
.jd-password-wrapper input[type="text"] {
    width: 100%;
    padding-right: 42px;
}
.jd-toggle-pass {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    font-size: 1.1em;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.jd-toggle-pass:hover {
    opacity: 1;
}

/* ─── PWA Install Button ─── */
.jd-pwa-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--jd-primary) 0%, var(--jd-primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}
.jd-pwa-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.5);
}
.jd-pwa-fab-icon { font-size: 1.2em; }

/* Botón de notificaciones push (apila sobre el FAB de instalación) */
.jd-push-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    transform: translateY(-74px);
    z-index: 99997;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.jd-push-fab:hover {
    transform: translateY(-76px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.45);
}
.jd-push-fab.jd-push-active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: rgba(255, 255, 255, 0.25);
}
.jd-push-fab.jd-push-active:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}
.jd-push-fab .jd-pwa-fab-icon { font-size: 1.15em; }

.jd-pwa-ios-panel {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.jd-pwa-ios-panel-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.jd-pwa-ios-panel-box h4 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 1.1em;
}
.jd-pwa-ios-icon { font-size: 2.5em; margin-bottom: 8px; }
.jd-pwa-ios-panel-box ol {
    text-align: left;
    padding-left: 18px;
    margin: 0;
    color: #334155;
    font-size: 0.9em;
    line-height: 1.7;
}
.jd-pwa-ios-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.1em;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.jd-pwa-ios-close:hover { color: #0f172a; }

@media (max-width: 480px) {
    .jd-pwa-fab { bottom: 14px; right: 14px; padding: 10px 14px; font-size: 0.85em; }
    .jd-push-fab { bottom: 14px; right: 14px; transform: translateY(-66px); padding: 9px 13px; font-size: 0.8em; }
    .jd-push-fab:hover { transform: translateY(-68px); }
}

/* ═══ GLOBAL RESPONSIVE POLISH ═══
   Refuerzos de movilidad para todas las páginas del plugin. */
@media (max-width: 600px) {
    /* Botones: área táctil cómoda */
    .jd-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    .jd-panel-tab, .jd-vp-tab {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Evitar desbordes por palabras largas */
    .jd-team-card-content, .jd-venue-card-content, .jd-challenge-card,
    .jd-form-section, .jd-panel-body, .jd-venue-section, .jd-form-card,
    .jd-tp-section, .jd-xp-section, .jd-vp-body, .jd-membership-current,
    .jd-tournament-info-card, .jd-reward-body, .jd-package-card,
    .jd-td-empty, .jd-plan-card, .jd-mk-card, .jd-zone-card,
    .jd-match-item, .jd-pending-item, .jd-role-card {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Fila de goleadores: apilar columnas */
    .jd-rm-scorer-row {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
    }

    /* Grids inline de 3 columnas: apilar (torneos, etc.) */
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Rankings: compactar celdas */
    .jd-rankings-table th, .jd-rankings-table td,
    .jd-panel-table th, .jd-panel-table td {
        padding: 10px 8px;
    }

    /* Monedero */
    .jd-wallet-points { font-size: 2.4em; }

    /* Historial: permitir wrap */
    .jd-history-list li, .jd-xp-history li, .jd-redemption-list li {
        flex-wrap: wrap;
    }

    /* Membresías: menos padding */
    .jd-memberships-wrapper { padding: 12px; }
    .jd-memberships-header h2 { font-size: 1.5em; }

    /* Retos: tarjetas de tipo apiladas a ancho completo */
    .jd-retos .jd-zone-card,
    [class*="jd-reto"] label {
        min-width: 100% !important;
    }

    /* Evitar scroll horizontal en popups/modales */
    .jd-form-card, .jd-form-section { max-width: 100%; }
}

/* === Wizard de Retos (cancha → árbitro → rival) === */
.jd-ch-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 0.85em;
    color: #94a3b8;
}
.jd-ch-step {
    padding: 6px 14px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}
.jd-ch-step-active {
    background: #1e293b;
    color: #fff;
    border-color: #1e293b;
}
.jd-ch-venue-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.jd-ch-venue-card.jd-ch-active {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.jd-ch-space {
    background: #f8fafc;
    transition: border-color .15s, background .15s;
}
.jd-ch-space:hover { border-color: #cbd5e1; }
.jd-ch-space input:checked + span { color: #166534; }
.jd-ch-referees label,
#jd-ch-referees label {
    transition: border-color .15s, background .15s;
}
#jd-ch-referees label:hover { border-color: #cbd5e1; }
.jd-ch-panel .jd-btn-large { padding: 12px; font-size: 1em; }



/* ═══════════════════════════════════════════════════════════════════
   BLINDAJE MÓVIL GLOBAL (mobile-safe)
   Reglas defensivas para que CUALQUIER página del plugin se comporte
   bien en celular, incluso cuando el HTML usa estilos inline.
   Solo AÑADE seguridad; no reescribe estructura. Reversible.
   Todo se limita a contenedores del plugin (clases jd-*) para no
   afectar el tema de WordPress.
   ═══════════════════════════════════════════════════════════════════ */

/* 1) Ningún contenedor del plugin debe provocar scroll horizontal */
[class*="jd-"] {
    max-width: 100%;
}

/* 2) Imágenes y multimedia nunca desbordan su contenedor */
[class*="jd-"] img,
[class*="jd-"] video,
[class*="jd-"] iframe,
[class*="jd-"] canvas,
[class*="jd-"] svg {
    max-width: 100%;
    height: auto;
}
/* Excepción: imágenes con height fijo intencional (logos, avatares, portadas)
   mantienen su object-fit; solo limitamos el ancho. */
[class*="jd-"] img[class*="logo"],
[class*="jd-"] img[class*="avatar"],
[class*="jd-"] img[class*="cover"],
[class*="jd-"] img[class*="thumb"] {
    height: auto;
}

/* 3) Tablas anchas: scroll interno en vez de romper la pantalla */
@media (max-width: 768px) {
    [class*="jd-"] table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 4) Texto largo (URLs, nombres) no rompe el layout */
.jd-panel-body, .jd-form-section, .jd-form-card, .jd-challenge-card,
.jd-tournament-info-card, .jd-vp-body, .jd-tp-section, .jd-xp-section,
.jd-sheet-card, .jd-mk-card, .jd-reward-body, .jd-plan-card {
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 600px) {

    /* 5) Grids inline (style="grid-template-columns:...") se apilan.
          Cubre 2, 3 y 4 columnas con y sin espacios, y auto-fit anchos. */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
    }

    /* Grids con auto-fit/minmax grandes: reducir el mínimo para que quepan */
    [style*="minmax(280px"],
    [style*="minmax(300px"],
    [style*="minmax(320px"] {
        grid-template-columns: 1fr !important;
    }

    /* 6) Flex inline que empujan ancho: permitir wrap */
    [style*="display:flex"],
    [style*="display: flex"] {
        flex-wrap: wrap;
    }
    /* No forzar wrap donde rompería el diseño a propósito */
    .jd-bracket,
    .jd-panel-tabs,
    .jd-vp-tabs,
    .jd-account-tabs,
    [class*="jd-"] [style*="overflow-x:auto"],
    [class*="jd-"] [style*="overflow-x: auto"] {
        flex-wrap: nowrap;
    }

    /* 7) Área táctil cómoda en controles del plugin */
    [class*="jd-"] button,
    [class*="jd-"] .jd-btn,
    [class*="jd-"] input[type="submit"],
    [class*="jd-"] input[type="button"] {
        min-height: 44px;
    }

    /* 8) Inputs a 16px mínimo: evita el zoom automático de iOS al enfocar */
    [class*="jd-"] input,
    [class*="jd-"] select,
    [class*="jd-"] textarea {
        font-size: 16px;
    }

    /* 9) Inputs y selects nunca desbordan */
    [class*="jd-"] input,
    [class*="jd-"] select,
    [class*="jd-"] textarea {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* 10) Paddings grandes inline: suavizar en pantallas pequeñas */
    [style*="padding:40px"],
    [style*="padding: 40px"],
    [style*="padding:44px"],
    [style*="padding: 44px"] {
        padding: 20px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   BLINDAJE DE BOTONES (color por defecto visible)
   Muchos botones usan class="jd-btn" SIN variante de color
   (jd-btn-primary/success/danger). La clase base .jd-btn no define
   fondo, así que quedaban transparentes/blancos e invisibles según el
   tema. Aquí le damos a .jd-btn un estilo por defecto visible.
   Las variantes de color siguen mandando (van después en el archivo
   o tienen mayor peso), así que esto NO cambia los botones ya
   coloreados; solo rescata los que quedaban sin fondo.
   ═══════════════════════════════════════════════════════════════════ */
.jd-btn {
    background: var(--jd-primary);
    color: #fff;
    line-height: 1.2;
}
.jd-btn:hover { background: var(--jd-primary-dark); color: #fff; }

/* Restaurar las variantes explícitas por si el orden las dejó por detrás */
.jd-btn.jd-btn-primary { background: var(--jd-primary); color: #fff; }
.jd-btn.jd-btn-primary:hover { background: var(--jd-primary-dark); }
.jd-btn.jd-btn-success { background: var(--jd-success); color: #fff; }
.jd-btn.jd-btn-success:hover { background: #15803d; }
.jd-btn.jd-btn-danger { background: var(--jd-danger); color: #fff; }
.jd-btn.jd-btn-danger:hover { background: #b91c1c; }
.jd-btn.jd-btn-secondary { background: #e2e8f0; color: #475569; }
.jd-btn.jd-btn-secondary:hover { background: #cbd5e1; color: #334155; }

/* Enlaces usados como botones: sin subrayado y con texto blanco legible */
a.jd-btn { text-decoration: none; }
a.jd-btn:not(.jd-btn-secondary) { color: #fff; }

/* Botones con fondo inline propio (gradientes, etc.): respetar su color de texto.
   Si traen background inline pero no color, el color #fff de arriba aplica y se ven bien. */

/* 11) Salvaguarda extra para pantallas muy angostas */
@media (max-width: 380px) {
    [class*="jd-"] {
        font-size: inherit;
    }
    /* Botones lado a lado que no caben: apilar */
    .jd-pending-actions,
    .jd-venue-mgmt-actions,
    .jd-mk-actions {
        flex-direction: column;
    }
    .jd-pending-actions .jd-btn,
    .jd-venue-mgmt-actions .jd-btn,
    .jd-mk-actions .jd-btn {
        width: 100%;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   MENÚ DE NAVEGACIÓN POR ROL (JD_Nav_Menu)
   Barra superior (desktop) + barra inferior tipo app (móvil).
   Shortcode [jd_menu] en estilo bar o list.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Barra superior fija (desktop) ── */
.jd-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.25);
}
.jd-navbar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 52px;
}
.jd-navbar-brand {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    font-size: 1.05em;
    white-space: nowrap;
    flex-shrink: 0;
}
.jd-navbar-scroll {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
}
.jd-navbar-scroll::-webkit-scrollbar { display: none; }
.jd-navbar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.jd-navbar-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.jd-navbar-item.is-current { background: var(--jd-primary); color: #fff; }
.jd-navbar-item .jd-nav-ico { font-size: 1.05em; }
.jd-navbar-logout { color: #fca5a5; }
.jd-navbar-logout:hover { background: rgba(220, 38, 38, 0.2); color: #fecaca; }

/* ── Barra inferior tipo app (móvil) ── */
.jd-tabbar { display: none; }

@media (max-width: 768px) {
    /* En móvil, la barra superior se oculta y aparece la tab bar inferior */
    .jd-navbar { display: none; }
    .jd-tabbar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9990;
        background: #fff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.12);
        padding: 4px 2px calc(4px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
    }
    .jd-tabbar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        flex: 1;
        min-width: 0;
        padding: 6px 2px;
        text-decoration: none;
        color: #64748b;
        min-height: 52px;
    }
    .jd-tabbar-ico { font-size: 1.35em; line-height: 1; }
    .jd-tabbar-label {
        font-size: 0.62em;
        font-weight: 600;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .jd-tabbar-item.is-current { color: var(--jd-primary); }
    .jd-tabbar-item.is-current .jd-tabbar-ico { transform: translateY(-1px); }
}

/* ── Shortcode [jd_menu] estilo barra inline ── */
.jd-nav-bar-inline {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px;
    margin: 12px 0;
    box-shadow: var(--jd-shadow);
}
.jd-nav-scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.jd-nav-scroll::-webkit-scrollbar { display: none; }
.jd-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #475569;
    font-size: 0.88em;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.jd-nav-item:hover { background: var(--jd-primary-soft); color: var(--jd-primary-dark); }
.jd-nav-item.is-current { background: var(--jd-primary); color: #fff; }

/* ── Shortcode [jd_menu] estilo lista (sidebar) ── */
.jd-nav-list { margin: 12px 0; }
.jd-nav-list-title { margin: 0 0 8px; font-size: 0.95em; color: var(--jd-gray-700); }
.jd-nav-list ul { list-style: none; padding: 0; margin: 0; }
.jd-nav-list li {
    border-bottom: 1px solid var(--jd-gray-100);
}
.jd-nav-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 8px;
    text-decoration: none;
    color: var(--jd-gray-700);
    font-size: 0.92em;
    font-weight: 500;
    transition: color 0.15s;
}
.jd-nav-list li a:hover { color: var(--jd-primary); }
.jd-nav-list li.is-current a { color: var(--jd-primary); font-weight: 700; }
.jd-nav-list .jd-nav-ico { font-size: 1.1em; }
