:root {
    --primary-red: #DC2626;
    --primary-blue: #2563EB;
    --bg-color: #F3F4F6;
    --card-bg: #FFFFFF;
    --text-color: #1F2937;
    --text-muted: #6B7280;
    --success: #10B981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

h1 {
    font-size: 2rem;
    color: var(--text-color);
}

.scoreboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .scoreboard {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

.team-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    border-top: 5px solid transparent;
}

.team-card.team-a {
    border-color: var(--primary-red);
}

.team-card.team-b {
    border-color: var(--primary-blue);
}

.team-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: block;
    width: 100%;
    border: none;
    text-align: center;
    background: transparent;
}

.score-display {
    font-size: 5rem;
    font-weight: 800;
    margin: 1rem 0;
}

.team-a .score-display { color: var(--primary-red); }
.team-b .score-display { color: var(--primary-blue); }

.controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    font-size: 1.25rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    text-align: center;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.btn-add {
    background-color: var(--success);
    color: white;
}
.btn-add:hover { background-color: #059669; }

.main-controls {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-reset {
    background-color: var(--text-muted);
    color: white;
}

.btn-history {
    background-color: #4B5563;
    color: white;
    text-decoration: none;
    display: inline-block;
}

/* Modal */
.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.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.winner-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.winner-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.history-table th, .history-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
}

.history-table th {
    background-color: #F9FAFB;
    font-weight: 600;
}

.winner-row {
    font-weight: bold;
    color: var(--success);
}

.setup-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.setup-input:focus {
    border-color: var(--primary-blue);
    outline: none;
}
