* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #B794F6 0%, #D6BCFA 25%, #E9D5FF 50%, #C4B5FD 75%, #A78BFA 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Decoração sutil de beach tennis */
.confetti {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15), 0 10px 25px rgba(255, 107, 53, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, #A78BFA, #C4B5FD, #D6BCFA) border-box;
    border-bottom: 3px solid transparent;
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
}

h1 {
    font-size: 2.8em;
    background: linear-gradient(135deg, #7C3AED, #A78BFA, #C4B5FD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.15em;
    color: #6B21A8;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-button {
    flex: 1;
    max-width: 250px;
    padding: 16px 32px;
    font-size: 1.05em;
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #7C3AED, #A78BFA) border-box;
    color: #7C3AED;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    transition: left 0.3s ease;
    z-index: -1;
}

.tab-button:hover::before {
    left: 0;
}

.tab-button:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.tab-button.active {
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: white;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
    border-color: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

h2 {
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.9em;
    font-weight: 700;
}

/* Classificação */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.standings-table th {
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.standings-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.standings-table tr:hover {
    background-color: #F3F4F6;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.standings-table tr:nth-child(even) {
    background-color: #fafafa;
}

.position {
    font-weight: 700;
    font-size: 1.2em;
    color: #7C3AED;
    width: 60px;
}

.team-name {
    font-weight: 600;
    color: #333;
}

.medal {
    font-size: 1.5em;
    margin-right: 5px;
}

/* Rodadas */
.round-section {
    margin-bottom: 40px;
}

.round-title {
    color: #7C3AED;
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, #7C3AED, #A78BFA, #C4B5FD) border-box;
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    text-align: center;
}

.courts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.court-badge {
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Jogos */
.match-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.match-card:hover {
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.15);
    transform: translateY(-3px);
}

.match-card.played {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-color: #4CAF50;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.match-number {
    font-weight: 600;
    color: #7C3AED;
    font-size: 1.05em;
}

.match-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.match-status.pending {
    background: #FFE082;
    color: #F57F17;
}

.match-status.played {
    background: #4CAF50;
    color: white;
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
}

.team {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.team-1 {
    text-align: right;
}

.team-2 {
    text-align: left;
}

.vs {
    font-weight: 700;
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4em;
}

.match-scores {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.score-input {
    display: flex;
    justify-content: center;
}

.score-input input {
    width: 80px;
    padding: 12px;
    font-size: 1.3em;
    text-align: center;
    border: 2px solid #7C3AED;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.score-input input:focus {
    outline: none;
    border-color: #A78BFA;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    transform: scale(1.05);
}

.score-input.team-1 {
    justify-content: flex-end;
}

.score-input.team-2 {
    justify-content: flex-start;
}

.match-buttons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.save-button {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.save-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #66BB6A, #4CAF50);
}

.save-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.delete-button {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #EF5350, #E57373);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delete-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(239, 83, 80, 0.3);
    background: linear-gradient(135deg, #E57373, #EF5350);
}

.delete-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.winner-indicator {
    font-size: 1.5em;
}

@media (max-width: 768px) {
    .container {
        padding: 25px 20px;
        border-radius: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 0.95em;
    }

    .tabs {
        flex-direction: column;
        gap: 12px;
    }

    .tab-button {
        max-width: 100%;
        padding: 14px 24px;
    }

    .courts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .round-title {
        font-size: 1.3em;
    }

    .standings-table {
        font-size: 0.85em;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .standings-table th,
    .standings-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    .match-card {
        padding: 16px;
    }

    .match-teams {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }

    .match-scores {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .team-1,
    .team-2 {
        text-align: center !important;
    }

    .vs {
        margin: 10px 0;
        order: 2;
    }

    .score-input {
        width: 100%;
        max-width: 200px;
        justify-content: center !important;
    }

    .score-input.team-1 {
        order: 1;
    }

    .score-input.team-2 {
        order: 3;
    }

    .score-input input {
        width: 100%;
        max-width: 120px;
        font-size: 1.4em;
        padding: 14px;
    }

    .winner-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.6em;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 0.9em;
    }

    h2 {
        font-size: 1.5em;
    }

    .standings-table {
        font-size: 0.75em;
    }

    .standings-table th,
    .standings-table td {
        padding: 8px 5px;
    }

    .match-card {
        padding: 14px;
    }

    .match-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .team {
        font-size: 1em;
    }
}
