/* Base Reset & Variables */
:root {
    --bg-gradient: radial-gradient(circle at 70% 80%, #5A7C49, #407C5A 60%, #0f2027);
    --card-bg: rgba(255,255,255,0.08);
    --glass-bg: rgba(255,255,255,0.15);
    --border-glass: rgba(255,255,255,0.25);
    /* Header accents */
    --header-accent1: #d01414; /* previously --accent */
    --header-accent2: #ffffff; /* previously --accent2 */
    /* Team accents */
    --team-accent1: #1f5bb4; /* team 1 colour */
    --team-accent2: #ff4c4c; /* team 2 colour */
    --danger: #ff4d4d;
    --ok: #3ddc97;
    --font-stack: 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition: 160ms ease;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-stack);
    background: var(--bg-gradient) fixed;
    color: #f0f4f9;
    -webkit-font-smoothing: antialiased;
}

/* Page-specific background variants */
body.index { /* Home */
    --bg-gradient: linear-gradient(135deg, #1f0033, #002f4f 90%, #fff);
}
body.teams { /* Teams */
    --bg-gradient: radial-gradient(circle at 70% 80%, #5A7C49, #70a085 60%, #0f2027);
}

/* Layout */
header { text-align: center; padding: 2.5rem 1rem 1rem; }
header h1 {
    margin: 0;
    font-size: clamp(2rem,4vw,3rem);
    letter-spacing: .05em;
    background: linear-gradient(90deg, var(--header-accent1), var(--header-accent2));
    -webkit-background-clip: text;
    color: transparent;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,.35));
}
.container { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }

/* Panels */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(14px) saturate(130%);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 12px 30px -10px rgba(0,0,0,.45), 0 2px 6px -1px rgba(0,0,0,.4);
    position: relative;
    overflow: hidden;
}
.panel::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
    pointer-events: none;
}

/* Player Input */
form#addPlayerForm { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 1.25rem; }
#playerName {
    flex: 1 1 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    color: #fff;
    padding: .65rem .9rem;
    font-size: 1rem;
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
}
#playerName:focus { border-color: var(--header-accent1); box-shadow: 0 0 0 2px rgba(255,204,0,.35); }
    /* Lighter, whiter placeholder styling */
    #playerName::placeholder {
        color: #ffffff;
        opacity: 0.85;
        font-weight: 300;
    }
input[type=button], button, .btn {
    background: linear-gradient(135deg, var(--header-accent1) 0%, #a6bcff 100%);
    color: #222;
    font-weight: 600;
    border: none;
    padding: .7rem 1.15rem;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: .5px;
    position: relative;
    transition: var(--transition);
    box-shadow: 0 6px 18px -6px rgba(255, 165, 0, .55), 0 1px 3px rgba(0,0,0,.4);
}
input[type=button]:hover, button:hover, .btn:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -6px rgba(255, 165, 0, .65); }
input[type=button]:active, button:active { transform: translateY(0) scale(.97); }

/* Player List */
ul#playerList {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .75rem;
}
ul#playerList li {
    background: var(--card-bg);
    padding: .6rem .75rem .55rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    animation: fadeIn .4s ease;
}
ul#playerList li button {
    background: linear-gradient(135deg, var(--danger), #410606);
    color: #fff;
    padding: .45rem .7rem;
    font-size: .7rem;
    border-radius: 8px;
    box-shadow: none;
}
ul#playerList li button:hover { filter: brightness(1.15); }

/* Teams Section */
.team1 .team-title {
    color: var(--team-accent1);
}
.team2 .team-title {
    color: var(--team-accent2);
}
.teams-wrapper { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 1.75rem; }
.team-panel { flex: 1 1 340px; }
.team-title {
    margin: 0 0 .9rem;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.team1 .badge {
    background: var(--team-accent1);
}
.team2 .badge {
    background: var(--team-accent2);
}
.team-title span.badge {
    
    color: #002b46;
    padding: .25rem .55rem .3rem;
    font-size: .65rem;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: .5px;
}
ul.team { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
ul.team li {
    background: var(--card-bg);
    padding: .55rem .7rem .5rem;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    font-size: .9rem;
    animation: slideUp .4s cubic-bezier(.25,.6,.3,1.2);
}
#team1 li { border-left: 4px solid var(--team-accent1); }
#team2 li { border-left: 4px solid var(--team-accent2); }

/* New Teams Btn */
#newTeams { margin: 1.25rem 0 0; }
#newTeams {
    background: linear-gradient(135deg, var(--header-accent2) 0%, #40b62b 100%);
    color: #022f4f;
    box-shadow: 0 6px 18px -6px rgba(93, 220, 255, .55), 0 1px 3px rgba(0,0,0,.4);
}
#newTeams:hover { box-shadow: 0 10px 26px -6px rgba(93,220,255,.65); }

/* Utilities */
.fade-in { animation: fadeIn .5s ease; }
.separator { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); margin: 2rem 0; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }
@keyframes slideUp { from { opacity: 0; transform: translateY(22px);} to { opacity: 1; transform: translateY(0);} }

/* Scrollbar styling (WebKit) */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.45); }

/* Responsive */
@media (max-width: 700px) {
    form#addPlayerForm { flex-direction: column; }
    input[type=button], button { width: 100%;}
    input[type=text] { max-height: 50px; opacity: 1; }
    .teams-wrapper { flex-direction: column; }
}
