/* src/main/resources/static/css/tournament-details.css */

.tournament-main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
    background: #f8f9fa;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.breadcrumb-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: #FF6B35;
}

.breadcrumb-separator {
    color: #6c757d;
    font-size: 0.8rem;
}

.breadcrumb-current {
    color: #212529;
    font-weight: 500;
}

/* Tournament Header */
.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tournament-title-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 1rem 0;
}

.tournament-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-level {
    background: #e3f2fd;
    color: #0d47a1;
}

.badge-type {
    background: #e8f5e9;
    color: #1b5e20;
}

.badge-modalidad {
    background: #ede7f6;
    color: #4527a0;
}

.badge-visibility {
    background: #fce7f3;
    color: #9d174d;
}

.badge-status {
    background: #fff3e0;
    color: #e65100;
}

.badge-status.badge-borrador {
    background: #e9ecef;
    color: #495057;
}

.badge-status.badge-publicado {
    background: #e3f2fd;
    color: #0d47a1;
}

.badge-status.badge-registro_abierto {
    background: #e8f5e9;
    color: #1b5e20;
}

.badge-status.badge-cerrado {
    background: #fff3e0;
    color: #e65100;
}

.badge-status.badge-finalizado {
    background: #f3e5f5;
    color: #4a148c;
}

.badge-status.badge-cancelado {
    background: #ffebee;
    color: #b71c1c;
}

.tournament-price {
    text-align: right;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    color: #FF6B35;
    display: block;
    line-height: 1.2;
}

.price-label {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Tournament Content */
.tournament-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* Info Cards */
.info-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card-title i {
    color: #FF6B35;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.info-item {
    display: flex;
    gap: 1rem;
}

.info-icon {
    width: 40px;
    height: 40px;
    background: #fff1eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FF6B35;
    font-size: 1.2rem;
}

.info-content {
    flex: 1;
}

.info-label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: #212529;
}

.tournament-description {
    line-height: 1.6;
    color: #495057;
}

.faq-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #FF6B35;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
}

.faq-link:hover {
    text-decoration: underline;
}

.contact-info p {
    margin: 0;
    color: #495057;
}

/* Sidebar */
.tournament-sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.registration-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.registration-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.user-registration-status {
    margin-bottom: 1.5rem;
}

.status-message {
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-waitlist {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.registration-position {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.availability-info {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.spots-available {
    font-size: 1.2rem;
    font-weight: 600;
}

.spots-good {
    color: #28a745;
}

.spots-full {
    color: #dc3545;
}

.spots-number {
    font-size: 2rem;
    margin-right: 0.25rem;
}

.waitlist-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.registration-closed {
    text-align: center;
    padding: 0.875rem 1rem;
    background: #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

.additional-info {
    font-size: 0.85rem;
    color: #6c757d;
}

.info-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.info-note i {
    color: #FF6B35;
    font-size: 0.9rem;
}

/* Share Card */
.share-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    text-align: center;
}

.share-card h4 {
    margin: 0 0 1rem 0;
    color: #212529;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.email {
    background: #6c757d;
}

/* Responsive */
@media (max-width: 1024px) {
    .tournament-content {
        grid-template-columns: 1fr;
    }

    .tournament-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .tournament-header {
        flex-direction: column;
        gap: 1rem;
    }

    .tournament-price {
        text-align: left;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

.btn-block.btn-register {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
}

.btn-block.btn-register:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.btn-block.btn-cancel {
    background: transparent;
    border: 1px solid var(--color-error);
    color: var(--color-error);
}

.btn-block.btn-cancel:hover {
    background: var(--color-error);
    color: white;
}

.btn-block.btn-login {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}

.btn-block.btn-login:hover {
    background: var(--color-primary);
    color: white;
}

/* King of Court preview */
.king-court-preview {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05), rgba(123, 44, 191, 0.05));
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 0.5rem;
}

.king-info {
    margin-bottom: 1.5rem;
}

.king-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--color-border-light);
}

.king-info-item:last-child {
    border-bottom: none;
}

.king-label {
    font-weight: 500;
    color: var(--color-text-light);
    min-width: 120px;
}

.king-value {
    font-weight: 600;
    color: var(--color-text);
}

.youtube-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ff0000;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s;
}

.youtube-link:hover {
    transform: scale(1.05);
    text-decoration: underline;
}

.king-actions {
    margin-top: 1rem;
}

.king-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.king-note i {
    color: var(--color-primary);
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 20px;
}

.modal-dialog {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-sm {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid #e9ecef;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #FF6B35, #e55a2b);
    color: white;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header .modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header .modal-title i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
/* Без -webkit-overflow-scrolling: touch — на iOS Safari оно создаёт отдельный
   композитный скролл-слой, который "захватывает" потомков с position:fixed
   (#partnerSearchResults/#manualPartnerSuggestions): они рендерятся относительно
   прокручиваемой области .modal-body (со сдвигом на её scrollTop), а не относительно
   реального вьюпорта, по которому их позиционирует JS. Инерционный скролл overflow:auto
   на iOS — поведение по умолчанию с iOS 13, свойство для него не нужно. */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.modal-footer {
    padding: 1.25rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Formulario en modal */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #212529;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 0.5rem;
    color: #FF6B35;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.form-control.is-invalid + .invalid-feedback {
    display: block;
}

.form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-text i {
    color: #FF6B35;
    font-size: 0.9rem;
}

/* Info message in modal */
.info-message {
    padding: 1rem 1.25rem;
    background-color: #fff1eb;
    border-left: 4px solid #FF6B35;
    border-radius: 8px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #212529;
    animation: fadeIn 0.3s ease-out;
}

.info-message i {
    color: #FF6B35;
    font-size: 1.25rem;
    flex-shrink: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botones en modal */
.modal-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
}

.modal-footer .btn-primary {
    background: #FF6B35;
    color: white;
}

.modal-footer .btn-primary:hover:not(:disabled) {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.modal-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-footer .btn-outline {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.modal-footer .btn-outline:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Result Modal */
#resultModal .modal-body {
    text-align: center;
    padding: 2rem;
}

#resultModal .modal-body i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

#resultModal .modal-body .success-icon {
    color: #28a745;
}

#resultModal .modal-body .error-icon {
    color: #dc3545;
}

#resultModal .modal-body .info-icon {
    color: #FF6B35;
}

#resultModal .modal-body h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin: 1rem 0 0.5rem;
}

#resultModal .modal-body p {
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    font-size: 1rem;
}

#resultModal .modal-footer {
    justify-content: center;
    border-top: none;
    padding-top: 0;
}

#resultModal .modal-footer .btn-primary {
    min-width: 200px;
}

/* Registration Confirm Modal */
#registrationConfirmModal .modal-body {
    text-align: center;
    padding: 2rem;
}

.reg-confirm-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin: 1rem 0 0.5rem;
}

.reg-confirm-subtitle {
    color: #6c757d;
    margin: 0 0 1.25rem;
    font-size: 1rem;
}

.reg-confirm-info-box {
    background: #fff7f4;
    border: 1px solid #ffe1d3;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: left;
}

.reg-confirm-info-box p {
    margin: 0 0 0.5rem;
    color: #495057;
    line-height: 1.5;
}

.reg-confirm-info-box p:last-child {
    margin-bottom: 0;
}

.reg-confirm-info-box__title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reg-confirm-info-box__title i {
    color: #FF6B35;
}

.reg-confirm-rules {
    margin: 0;
    padding-left: 1.25rem;
    color: #495057;
}

.reg-confirm-rules li {
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.reg-confirm-rules li:last-child {
    margin-bottom: 0;
}

#registrationConfirmModal .modal-footer {
    justify-content: center;
    border-top: none;
    padding-top: 0;
}

#registrationConfirmModal .modal-footer .btn-primary {
    min-width: 200px;
}

/* Animation for spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 10px;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    #resultModal .modal-body i {
        font-size: 3rem;
    }

    #resultModal .modal-body h4 {
        font-size: 1.25rem;
    }
}

/* Placeholder styling */
.form-control::placeholder {
    color: #adb5bd;
    font-size: 0.95rem;
}

/* Additional styles for form groups */
.form-group:last-child {
    margin-bottom: 0;
}

/* Phone input specific */
input[type="tel"].form-control {
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #FF6B35;
    background: #fff5f0;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ced4da;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #FF6B35;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 12px;
    height: 12px;
    background: #FF6B35;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-text {
    flex: 1;
    font-size: 14px;
}

.radio-text strong {
    display: block;
    margin-bottom: 4px;
    color: #212529;
}

.text-muted {
    color: #6c757d;
    font-size: 12px;
}

.d-block {
    display: block;
}

.mb-2 {
    margin-bottom: 8px;
}

/* Danger button */
.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

/* ===== АДАПТИВНОСТЬ МОДАЛЬНЫХ ОКОН ===== */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-dialog {
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
    }

    .modal-content {
        border-radius: 20px;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
        position: sticky;
        top: 0;
        z-index: 10;
        border-radius: 20px 20px 0 0;
    }

    .modal-header .modal-title {
        font-size: 1.1rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .modal-header .modal-title i {
        font-size: 1.3rem;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 1.5rem;
        overflow-y: auto;
        max-height: calc(90vh - 140px);
    }

    .modal-footer {
        padding: 1.25rem 1.5rem;
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid #e9ecef;
        z-index: 10;
        border-radius: 0 0 20px 20px;
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
        min-width: auto;
        padding: 1rem;
        font-size: 1rem;
        margin: 0;
    }

    /* Специально для модалки парной регистрации */
    #partnerModal .modal-body {
        max-height: calc(90vh - 160px);
    }

    #partnerModal .form-group {
        margin-bottom: 1.25rem;
    }

    #partnerModal .form-control {
        padding: 1rem;
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    #partnerModal .form-text {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }

    /* Для модалки отмены */
    #doubleCancelModal .modal-body {
        max-height: calc(90vh - 140px);
    }

    .radio-label {
        padding: 12px;
    }

    .radio-text {
        font-size: 0.9rem;
    }

    .radio-text strong {
        font-size: 1rem;
    }

    .text-muted {
        font-size: 0.8rem;
    }

    /* Поля для замены игрока */
    #replacePlayerFields .form-control {
        margin-bottom: 0.75rem;
    }

    #replacePlayerFields .form-control:last-child {
        margin-bottom: 0;
    }

    /* Информационное сообщение */
    .info-message {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        margin-top: 0.75rem;
    }

    .info-message i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 1rem 1.25rem;
    }

    .modal-header .modal-title {
        font-size: 1rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .form-group label i {
        font-size: 0.9rem;
    }

    .form-control {
        padding: 0.875rem;
        font-size: 15px;
    }

    /* Для маленьких экранов делаем заголовок компактнее.
       #modalTournamentName с фиксированным max-width и nowrap+ellipsis в одном ряду
       flex-контейнера с лейблом "Registrar pareja para" оставлял лейблу слишком мало
       места: он переносился по буквам, а название турнира обрезалось многоточием.
       flex-wrap переносит название турнира на свою строку на всю ширину — лейбл
       не сжимается, название видно целиком (без обрезки). */
    #partnerModalLabel {
        white-space: normal;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    #partnerModalLabel i {
        margin-top: 2px;
    }

    #partnerModalLabel .modal-partner-title-text {
        white-space: nowrap;
    }

    #modalTournamentName {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .modal-header {
        padding: 0.875rem 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.875rem 1rem;
    }

    .modal-header .modal-title {
        font-size: 0.95rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-control {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

/* Улучшаем скролл на мобильных */
.modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 4px;
}

/* Улучшенное отображение описания с переносами строк */
.tournament-description {
    line-height: 1.6;
    color: var(--admin-dark);
    white-space: pre-line; /* Сохраняет переносы строк */
    word-wrap: break-word; /* Переносит длинные слова */
    font-size: 1rem;
    padding: 0.5rem 0;
}

.tournament-description br {
    display: block;
    content: "";
    margin-top: 0.5rem;
}

.tournament-description p {
    margin-bottom: 1rem;
}

.tournament-description ul,
.tournament-description ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.tournament-description li {
    margin-bottom: 0.25rem;
}

.registration-actions {
    scroll-margin-top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-icon.move-to-waitlist {
    color: #f59e0b;
}

.btn-icon.move-to-waitlist:hover {
    background-color: #fff3cd;
    color: #b45309;
}

.btn-icon.move-to-main {
    color: #10b981;
}

.btn-icon.move-to-main:hover {
    background-color: #d1fae5;
    color: #047857;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

/* Ниже — второй блок правил .modal/.modal-content/.modal-body/..., дублирующий набор
   выше (строка ~536) с другими значениями; специфичность у обоих одинаковая, этот блок
   идёт в файле позже, поэтому .modal-content/.modal-body/.modal-footer/.form-group/
   .form-control отсюда побеждают везде на сайте — их изменение поменяло бы вид всех
   модалок. Правила .modal-dialog здесь нет: оно перебивало бы мобильный
   @media (max-width: 768px) выше (width: 100%), и на телефоне модалка оставалась бы
   90% ширины с пустыми полями по бокам. */

.modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ef4444;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.form-group label i {
    margin-right: 0.5rem;
    color: #FF6B35;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

textarea.form-control {
    resize: vertical;
}

.btn-register.btn-primary.btn-block,
.btn-cancel.btn-outline.btn-block,
.btn-login.btn-outline.btn-block {
    display: flex;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

.btn-register.btn-primary.btn-block {
    background: linear-gradient(135deg, #FF6B35, #e55a2b);
    color: white;
    border: none;
}

.btn-register.btn-primary.btn-block:hover:not(:disabled) {
    background: linear-gradient(135deg, #e55a2b, #FF6B35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-register.btn-primary.btn-block:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel.btn-outline.btn-block {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    text-decoration: none;
}

.btn-cancel.btn-outline.btn-block:hover {
    background: #dc3545;
    color: white;
}

.btn-login.btn-outline.btn-block {
    background: transparent;
    border: 1px solid #FF6B35;
    color: #FF6B35;
    text-decoration: none;
}

.btn-login.btn-outline.btn-block:hover {
    background: #FF6B35;
    color: white;
}

/* Бейджи в заголовке турнира — скругление и цвета */
.tournament-badges .badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
    display: inline-block;
}

.tournament-badges .badge-level  { background: #e3f2fd; color: #0d47a1; }
.tournament-badges .badge-modalidad { background: #ede7f6; color: #4527a0; }
.tournament-badges .badge-type   { background: #e8f5e9; color: #1b5e20; }
.tournament-badges .badge-status { background: #fff3e0; color: #e65100; }
.tournament-badges .badge-visibility { background: #fce7f3; color: #9d174d; }
.tournament-badges .badge-status.badge-borrador         { background: #e9ecef; color: #495057; }
.tournament-badges .badge-status.badge-publicado        { background: #e3f2fd; color: #0d47a1; }
.tournament-badges .badge-status.badge-registro_abierto { background: #e8f5e9; color: #1b5e20; }
.tournament-badges .badge-status.badge-cerrado          { background: #fff3e0; color: #e65100; }
.tournament-badges .badge-status.badge-finalizado       { background: #f3e5f5; color: #4a148c; }
.tournament-badges .badge-status.badge-cancelado        { background: #ffebee; color: #b71c1c; }

/* ── Кнопки выбора режима регистрации ── */
.mode-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .65rem 1rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    text-align: left;
}
.mode-btn:hover { border-color: #FF6B35; color: #FF6B35; background: #fff7f4; }
.mode-btn--active { border-color: #FF6B35; color: #FF6B35; background: #fff7f4; font-weight: 600; }

/* ── Блок «ищу партнёра» на странице турнира ── */
.looking-for-partner-block { margin-bottom: 1.5rem; }
.looking-for-partner-block h3 { font-size: 1rem; font-weight: 600; color: #1f2937; margin-bottom: .75rem; }
.lp-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .9rem;
    background: #eff6ff;
    border-radius: 8px;
    margin-bottom: .4rem;
    font-size: .9rem;
}
.lp-card-name { font-weight: 600; color: #1e40af; flex: 1; }
.lp-card-nivel { font-size: .8rem; color: #6b7280; }
.lp-card-contacts { display: flex; gap: .4rem; }
.lp-contact-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .6rem; border-radius: 6px;
    font-size: .8rem; font-weight: 500; text-decoration: none; color: white;
}
.lp-contact-btn--tg  { background: #0088cc; }
.lp-contact-btn--wa  { background: #25d366; }
.lp-empty { font-size: .875rem; color: #9ca3af; padding: .5rem 0; }
.lp-propose-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .7rem; border-radius: 6px;
    font-size: .8rem; font-weight: 600; border: none; cursor: pointer;
    background: linear-gradient(135deg, #FF6B35, #e55a2b); color: white;
    transition: opacity .2s;
}
.lp-propose-btn:disabled { opacity: .6; cursor: not-allowed; }
.lp-no-contact-hint {
    position: relative;
    display: inline-flex; align-items: center;
    background: none; border: none; cursor: pointer;
    color: #f59e0b; font-size: 1.1rem; padding: 0;
}
.lp-no-contact-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    width: 220px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: .78rem;
    line-height: 1.4;
    padding: .5rem .7rem;
    border-radius: 7px;
    z-index: 10;
    pointer-events: none;
    text-align: left;
    white-space: normal;
}
.lp-no-contact-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; right: 8px;
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.lp-no-contact-hint:hover .lp-no-contact-tooltip,
.lp-no-contact-hint:focus .lp-no-contact-tooltip,
.lp-no-contact-hint:focus-within .lp-no-contact-tooltip {
    display: block;
}
.calendar-picker { position: relative; margin-top: 1.25rem; }
.calendar-toggle { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.25rem; min-height: 44px;
    background: #FF6B35; color: #fff; border: 0; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.calendar-toggle:hover { opacity: .85; }
.calendar-toggle:focus-visible, .calendar-options a:focus-visible, .calendar-help summary:focus-visible {
    outline: 3px solid #1d4ed8; outline-offset: 3px; }
.calendar-options[hidden], .calendar-status[hidden] { display: none; }
.calendar-options { position: absolute; z-index: 20; top: calc(100% + .5rem); left: 0; width: min(350px, 100%);
    max-height: min(70vh, 560px); overflow-y: auto; padding: .5rem; border: 1px solid #e5e7eb; border-radius: 12px;
    background: #fff; color: #1f2937; box-shadow: 0 8px 24px #0002; }
.calendar-links { list-style: none; padding: 0; margin: 0; }
.calendar-links a { display: flex; align-items: center; min-height: 44px; padding: .65rem .75rem; border-radius: 6px;
    color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.calendar-links a:hover { background: #fff3ed; }
.calendar-links a[aria-disabled="true"] { opacity: .5; cursor: default; }
.calendar-help { border-top: 1px solid #e5e7eb; margin-top: .3rem; padding: .5rem .75rem; font-size: .85rem; line-height: 1.5; }
.calendar-help summary { cursor: pointer; min-height: 44px; align-content: center; }
.calendar-help p, .calendar-status { margin: .5rem 0; }
.calendar-help input { width: 100%; box-sizing: border-box; padding: .6rem; font: inherit; border: 1px solid #d1d5db; border-radius: 6px; }
.calendar-status { padding: .5rem .75rem; font-size: .9rem; }
@media (max-width: 600px) {
    .calendar-options { position: fixed; top: auto; bottom: 1rem; left: 1rem; right: 1rem; width: auto; max-height: 70vh; max-height: 70dvh; }
}
