:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --background-color: #f5f6fa;
    --team-a-color: #2c3e50;
    --team-b-color: #e74c3c;
    --team-c-color: #3498db;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: var(--background-color);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

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

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.back-button {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.back-button:hover {
    transform: translateY(-2px);
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.team-score {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    flex: 1;
}

.team-a {
    background-color: #2c3e50; /* Azul escuro */
    color: white;
}

.team-b {
    background-color: #e74c3c; /* Vermelho */
    color: white;
}

.team-score h2 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    color: white;
}

.score {
    font-size: 4rem;
    font-weight: bold;
    margin: 10px 0;
    color: white;
}

.team-players {
    font-size: 0.9rem;
    font-weight: normal;
    color: #666;
    display: block;
    margin-top: 5px;
    line-height: 1.4;
}

.score-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.score-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #DCF7E8; /* Verde claro suave */
    color: #2c3e50; /* Cor do texto em azul escuro para contraste */
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.score-btn.minus {
    opacity: 0.8;
}

.match-info {
    text-align: center;
    padding: 0 30px;
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: monospace;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.3s;
    color: white;
    display: block;
    width: 100%;
    padding: 12px 20px;
    margin: 10px 0;
    font-size: 1.1rem;
    border-radius: 8px;
}

#startButton {
    background-color: var(--team-b-color); /* Vermelho alaranjado */
    color: white;
}

#startButton:hover {
    background-color: #c0392b; /* Vermelho alaranjado mais escuro */
    transform: translateY(-2px);
}

#resetButton {
    background-color: var(--primary-color); /* Azul escuro */
    color: white;
}

#resetButton:hover {
    background-color: #1a252f; /* Azul escuro mais escuro */
    transform: translateY(-2px);
}

.match-history {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.match-history h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-record {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.match-details {
    flex: 1;
}

.teams-display {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.teams-display div {
    margin: 2px 0;
}

.match-time {
    color: #666;
    text-align: right;
    white-space: nowrap;
}

.match-record .score-display {
    font-weight: bold;
}

.current-teams {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.current-teams h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.team-card {
    padding: 15px;
    border-radius: 10px;
    background: var(--background-color);
}

.team-card.team-a { border-left: 4px solid var(--team-a-color); }
.team-card.team-b { border-left: 4px solid var(--team-b-color); }
.team-card.team-c { border-left: 4px solid var(--team-c-color); }

.team-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.team-card.team-a h4 { color: var(--team-a-color); }
.team-card.team-b h4 { color: var(--team-b-color); }
.team-card.team-c h4 { color: var(--team-c-color); }

.team-list {
    list-style: none;
    padding: 0;
}

.team-list li {
    padding: 8px;
    margin: 5px 0;
    background: white;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.team-list li:hover {
    transform: translateX(5px);
    transition: transform 0.2s;
}

.match-settings {
    margin: 15px 0;
    text-align: center;
}

.points-label {
    display: block;
    color: #666;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.points-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.points-btn {
    background: var(--background-color);
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.points-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.points-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Estilo do footer e botão de instalação */
.footer {
    background-color: #f8f9fa;
    padding: 20px 0;
    margin-top: 40px;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-icon {
    font-size: 24px;
    color: #3498db;
    animation: bounce 2s infinite;
}

.footer-text {
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* Estilo do botão de instalação */
.install-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.install-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.install-button:active {
    transform: translateY(0);
}

.install-button i {
    font-size: 16px;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .install-button {
        margin-top: 10px;
    }
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-text {
        align-items: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    .scoreboard {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

    .team-score {
        width: 100%;
    }

    .match-info {
        width: 100%;
        padding: 15px 0;
    }

    .timer {
        font-size: 2.5rem;
    }

    .match-record {
        flex-direction: column;
    }

    .match-time {
        text-align: left;
    }

    .team-players {
        font-size: 0.8rem;
    }

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

    .team-card {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .score {
        font-size: 4rem;
    }

    .team-score h2 {
        font-size: 1.5rem;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Estilos para o efeito de vitória */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease-out;
}

.victory-content {
    text-align: center;
    color: white;
    animation: scaleIn 0.5s ease-out;
    z-index: 10000;
}

.victory-icon {
    font-size: 80px;
    color: gold;
    margin-bottom: 20px;
    animation: trophy 2s infinite;
    display: block;
}

.victory-message {
    font-size: 40px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
}

.confetti {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 30px;
    background: linear-gradient(45deg, #3498db, #2ecc71, #e74c3c, #f1c40f);
    top: -20px;
    animation: confettiFall 3s linear infinite;
    animation-delay: var(--delay);
    transform: rotate(var(--rotation));
}

.fade-out {
    animation: fadeOut 1s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes trophy {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(var(--rotation));
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(calc(var(--rotation) + 360deg));
        opacity: 0;
    }
}
