* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    line-height: 1.5;
    padding-bottom: 50px;
}

.navbar {
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #38bdf8;
}

.badge {
    background-color: #0284c7;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 6px;
}

.league-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #0f172a;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #0284c7;
}

.league-selector-wrapper label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

.league-selector-wrapper select {
    background: transparent;
    color: white;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.league-selector-wrapper select option {
    background-color: #1e293b;
    color: white;
}

.nav-links {
    display: flex;
    gap: 6px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: #f8fafc;
    background-color: #334155;
}

.nav-btn.active {
    color: white;
    background-color: #0284c7;
}

.container {
    max-width: 1300px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.search-section {
    margin-bottom: 1.5rem;
}

#globalSearch {
    width: 100%;
    padding: 12px 18px;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}

.card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.card h3 {
    color: #38bdf8;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.card-subtitle, .subtitle-sm {
    color: #94a3b8;
    font-size: 0.85rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 0.75rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th {
    background-color: #0f172a;
    color: #38bdf8;
    padding: 10px;
    border-bottom: 2px solid #334155;
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid #334155;
}

tr:hover {
    background-color: #2b394e;
}

.team-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.team-link:hover {
    text-decoration: underline;
    color: #7dd3fc;
}

.team-logo-small {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
    object-fit: contain;
}

.player-headshot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
    object-fit: cover;
    background-color: #334155;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: #1e293b;
    border: 1px solid #0284c7;
    border-radius: 12px;
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.team-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-logo-large {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.close-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.close-btn:hover { background: #dc2626; }

.modal-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 8px;
}

.modal-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

.modal-tab-btn.active {
    background-color: #0284c7;
    color: white;
}

.modal-sub-content { display: none; }
.modal-sub-content.active { display: block; }

.btn-toggle {
    background: #0f172a;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-toggle.active {
    background: #0284c7;
    color: white;
    border-color: #0284c7;
}

.diamond-container {
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1rem;
    position: relative;
    min-height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.diamond-field {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 380px;
    background: radial-gradient(circle at 50% 80%, #15803d 0%, #064e3b 70%);
    border-radius: 50% 50% 10px 10px;
    border: 2px solid #22c55e;
}

.pos-card {
    position: absolute;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid #38bdf8;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    min-width: 110px;
    text-align: center;
}

.pos-label {
    display: inline-block;
    background: #0284c7;
    color: white;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
}

.pos-cf { top: 15px; left: 50%; transform: translateX(-50%); }
.pos-lf { top: 55px; left: 12%; }
.pos-rf { top: 55px; right: 12%; }
.pos-ss { top: 155px; left: 28%; }
.pos-2b { top: 155px; right: 28%; }
.pos-3b { top: 235px; left: 8%; }
.pos-1b { top: 235px; right: 8%; }
.pos-c  { bottom: 15px; left: 50%; transform: translateX(-50%); }

.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.subtitle { color: #94a3b8; margin-bottom: 1rem; }
