body {
    min-height: 100vh;
    background: #f4f6f9;
    font-family: 'Segoe UI', sans-serif;
}

.league-container {
    margin: 40px auto;
    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
}

.league-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    transition: .3s;
    width: 60%;
}

.league-card:hover {
    transform: translateY(-5px);
}

.league-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.league-header h2 {
    margin: 0;
    color: #222;
    font-size: 1.4rem;
}

.league-description {
    color: #666;
    margin-bottom: 20px;
    min-height: 50px;
}

/* Liga pública */
.public {
    border-left: 6px solid #28a745;
}

.public-badge {
    background: #28a745;
    color: white;
}

/* Liga privada */
.private {
    border-left: 6px solid #dc3545;
}

.private-badge {
    background: #dc3545;
    color: white;
}

.badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: .8rem;
    font-weight: bold;
}

.join-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #0d6efd;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: .3s;
}

.join-btn:hover {
    background: #0b5ed7;
}

.code-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.code-group label {
    font-size: .9rem;
    font-weight: 600;
    color: #444;
}

.code-input {
    width: 40%;
    padding: 12px;
    border: 2px solid #9c9c9c;
    border-radius: 10px;
    font-size: .95rem;
    transition: .3s;
    outline: none;
    box-sizing: border-box;
}

.code-input:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .15);
}

.private .code-input {
    background: #cecece;
}

.code-input::placeholder {
    color: rgb(104, 104, 104)
}

.search-container {
    max-width: 900px;
    margin: 30px auto 10px auto;
    padding: 0 20px;
}

.search-form {
    display: flex;
    gap: 12px;
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.search-form input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    transition: .3s;
}

.search-form input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13,110,253,.15);
}

.search-form button {
    border: none;
    border-radius: 12px;
    background: #0d6efd;
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: .3s;
}

.search-form button:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
}

@media (max-width: 840px){
    .league-card{
        width: 100%;
    }
    .code-input{
        width: 80%;
    }
}

.league-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.join-btn,
.view-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: .3s;
}

.join-btn {
    background: #2ecc71;
    color: white;
}

.join-btn:hover {
    background: #27ae60;
}

.view-btn {
    background: #f4f6f8;
    color: #333;
    border: 1px solid #ddd;
}

.view-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.create-league-container {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.create-league-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(46, 204, 113, 0.25);
    transition: all 0.3s ease;
}

.create-league-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(46, 204, 113, 0.35);
}

.create-league-btn:active {
    transform: translateY(0);
}