:root {
    --primary: #2563EB; /* Tennis Ball Yellow/Green */
    --primary-dark: #1D4ED8;
    --bg-dark: #121212;
    --bg-card: #1E1E1E;
    --text-main: #FFFFFF;
    --text-muted: #B0B0B0;
    --danger: #FF4444;
    --input-bg: #2C2C2C;
    --border: #333;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 { color: var(--text-main); font-weight: 700; margin-top: 0; }

.btn {
    background-color: var(--primary);
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    width: 100%;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:active { transform: scale(0.98); }
.btn-secondary { background-color: var(--input-bg); color: var(--text-main); border: 1px solid var(--border); }
.btn-sm { padding: 8px 16px; font-size: 14px; margin-top: 10px; width: auto; display: inline-block; }

.card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    margin-bottom: 0; /* Handled by form-group */
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group {
    margin-bottom: 24px;
}

/* Match Recording */
.set-header {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.set-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.set-label {
    font-weight: bold;
    color: var(--text-muted);
    text-align: center;
}

.score-input {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
}

.add-set-btn {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}
.add-set-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Dashboard Specifics */
.match-item {
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
}
.match-item:last-child { border-bottom: none; }
.winner { color: var(--primary); font-weight: bold; }

.user-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    align-items: center;
}
.user-row.top-3 { background: rgba(255,255,255,0.05); }
.elo-badge {
    background: var(--input-bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-family: monospace;
    color: var(--primary);
}

/* Leaderboard 2.0 */
.rank-1 { color: #FFD700 !important; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.rank-2 { color: #C0C0C0 !important; }
.rank-3 { color: #CD7F32 !important; }
.rank-icon { font-size: 18px; margin-right: 5px; }

/* Tournaments */
.tournament-card {
    border-left: 4px solid var(--primary);
}

.bracket-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    overflow-x: auto;
    padding: 20px 0;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 150px;
}

.bracket-match {
    background: #2C2C2C;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    position: relative;
    font-size: 12px;
}

.bracket-match::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    width: 20px;
    height: 1px;
    background: #444;
}

.bracket-round:last-child .bracket-match::after { display: none; }

/* Admin */
.btn-danger {
    background-color: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    margin-top: 40px;
    font-size: 12px;
    padding: 8px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.toggle-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--text-muted);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}
.toggle-btn.active {
    background: var(--primary);
    color: white;
}
.toggle-btn:first-child {
    border-radius: 20px 0 0 20px;
    border-right: none;
}
.toggle-btn:last-child {
    border-radius: 0 20px 20px 0;
    border-left: none;
}

/* Remove Leaderboard Colors Override if desired, but user just said "don't do gold silver bronze colors" */
/* I will override them back to normal text color in specific context or just remove the class injection in JS */

/* Match Card */
.match-card {
    background: var(--bg-card);
    border-left: 4px solid var(--border);
    margin-bottom: 12px;
    padding: 15px;
    transition: transform 0.2s;
}
.match-card:hover {
    transform: translateY(-2px);
    border-left-color: var(--primary);
}

/* Floating Action Bar (Optional concept if sticky bottom needed, currently just static bottom) */
.floating-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    padding: 15px;
    border-top: 1px solid #333;
    z-index: 100;
}
/* Adjust body padding for floating bar */
body { padding-bottom: 130px; }

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