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

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
}

/* ===== LIGHT & DARK MODE VARIABLES ===== */
:root {
    --bg: #ffffff;
    --text: #111;
    --card: #f5f5f5;
    --accent: #c40000;
}

.dark {
    --bg: #121212;
    --text: #f2f2f2;
    --card: #1e1e1e;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    /* removed position: relative since button is fixed */
}

header img {
    width: 90px;
    height: auto;          /* keep aspect ratio */
    max-height: 90px;      /* optional max height */
    border-radius: 0;      /* remove rounding */
    object-fit: contain;   /* show entire logo */
    margin: 0 auto;
    display: block;
}

#themeToggle {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 14px;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
    z-index: 1000;
}

/* ===== PLAYERS SECTION ===== */
#playersSection {
    max-width: 600px;
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

#addPlayerBtn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 20px;
}

#addPlayerBtn:hover {
    background: #800000;
}

/* ===== PLAYER CARDS ===== */
#playersList .playerCard {
    background: var(--card);
    padding: 15px;
    margin: 10px auto;
    border-radius: 10px;
    display: flex;
    gap: 15px;
    align-items: center;
    max-width: 500px;
    transition: background 0.3s;
}

.playerCard img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.playerCard .info {
    flex-grow: 1;
    text-align: left;
}

.playerCard input {
    margin-top: 5px;
    width: 100%;
    font-size: 1rem;
    padding: 6px;
    border: 1px solid var(--accent);
    border-radius: 6px;
}

.playerCard .saveBtn,
.playerCard .editBtn {
    padding: 8px 14px;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.playerCard .saveBtn:hover,
.playerCard .editBtn:hover {
    background: #800000;
}

.playerCard .info h3,
.playerCard .info p {
    margin: 6px 0;
}

/* ===== TEAM RECORD ===== */
#recordSection {
    max-width: 400px;
    width: 100%;
    margin-top: 40px;
    text-align: center;
}

#recordInputs {
    font-size: 2.8rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0 auto 10px auto;
    max-width: 220px;
}

#recordInputs input {
    width: 60px;
    text-align: center;
    font-weight: 700;
    font-size: 2.8rem;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text);  /* fixes dark mode input text color */
}

/* ===== MOBILE OPTIMIZATION ===== */
@media (max-width: 600px) {
    header img {
        width: 70px;
        height: auto;
        max-height: 70px;
    }

    #playersList .playerCard {
        flex-direction: column;
        text-align: center;
        align-items: center;
        max-width: 90vw;
    }

    #playersSection, #recordSection {
        max-width: 90vw;
    }
}
