:root {
    --primary: #009B31;
    --primary-dark: #007C27;
    --primary-soft: #E6F5EA;
    --accent: #A4C400;
    --accent-soft: #F0F6D5;
    --page: #F2F5F2;
    --surface: #FFFFFF;
    --ink: #172019;
    --muted: #667068;
    --border: #D7DED8;
    --court-line: #16652E;
    --q3: #BFE8C8;
    --q2: #EAF29D;
    --q1: #FFDFA1;
    --q0: #F7B4AE;
    --qn: #EEF1EF;
    --traffic-green: #21A657;
    --traffic-yellow: #F0B429;
    --traffic-red: #D64545;
    --traffic-neutral: #7A8580;
    --nav-h: 50px;
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--page);
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.auth-version {
    position: fixed;
    top: max(4px, env(safe-area-inset-top));
    right: 8px;
    z-index: 3;
    font-size: 9px;
    font-weight: 800;
    color: var(--muted);
}
.auth-page { height: 100dvh; display: grid; place-items: center; padding: 18px; }
.auth-card {
    width: min(430px, 92vw);
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 18px 50px rgba(23,32,25,.12);
}
.auth-mark {
    width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary); color: white; font-weight: 950; letter-spacing: .03em;
}
.auth-card h1 { margin: 14px 0 6px; font-size: 1.55rem; }
.auth-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.4; }
.auth-error { padding: 9px 11px; margin-bottom: 12px; border-radius: 9px; background: #FDEDEC; color: #9C2F2F; font-weight: 700; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { display: grid; gap: 4px; font-size: .78rem; font-weight: 800; }
.auth-form input { height: 42px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; }
.auth-submit { margin-top: 4px; }

.app { width: 100vw; height: 100dvh; overflow: hidden; }
.top-nav {
    position: relative;
    height: calc(var(--nav-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 8px 0;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    border-bottom: 3px solid var(--accent);
    overflow: hidden;
}
.version-stamp {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 1px);
    left: 8px;
    color: rgba(255,255,255,.82);
    font-size: 8px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .04em;
    pointer-events: none;
}
.brand {
    padding-top: 5px;
    color: white;
    font-weight: 900;
    font-size: clamp(.74rem, 1.6vw, 1rem);
    white-space: nowrap;
}
.nav-buttons {
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
}
.nav-button, .logout-button {
    height: 32px;
    border-radius: 7px;
    padding: 0 clamp(7px, 1.2vw, 14px);
    border: 1px solid rgba(255,255,255,.38);
    color: white;
    background: rgba(255,255,255,.08);
    font-size: clamp(.63rem, 1.1vw, .8rem);
    font-weight: 850;
    white-space: nowrap;
}
.nav-button.active { background: var(--accent); color: #173415; border-color: var(--accent); }
.logout-form { margin: 0; padding-top: 3px; }
.logout-button { padding: 0 9px; background: rgba(0,0,0,.10); }

.view-stack { position: relative; height: calc(100dvh - var(--nav-h) - env(safe-area-inset-top)); overflow: hidden; }
.view { position: absolute; inset: 0; display: none; padding: 8px; overflow: hidden; }
.view.active { display: block; }

.view-toolbar {
    min-width: 0; height: 42px; background: white; border: 1px solid var(--border); border-radius: var(--radius);
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 9px; overflow: hidden;
}
.toolbar-left { min-width: 0; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.toolbar-left strong { flex: 0 0 auto; font-size: .87rem; white-space: nowrap; }
.toolbar-note { min-width: 0; color: var(--muted); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.small-action, .primary-action, .team-current-button {
    height: 32px; border-radius: 8px; padding: 0 10px; font-size: .72rem; font-weight: 850; white-space: nowrap;
}
.small-action, .team-current-button { border: 1px solid var(--border); background: white; color: var(--ink); }
.small-action.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.primary-action { border: 1px solid var(--primary); background: var(--primary); color: white; }
.primary-action.wide { width: 100%; }
.team-current-button { max-width: min(34vw, 260px); overflow: hidden; text-overflow: ellipsis; border-color: #B7CDBD; background: var(--primary-soft); color: var(--primary-dark); }
.selection-info { font-size: .72rem; font-weight: 850; color: var(--primary-dark); white-space: nowrap; }

.set-button-group { display: grid; grid-template-columns: repeat(5, 30px); gap: 3px; }
.set-button-group button {
    width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 7px; background: white; color: var(--ink); font-size: .72rem; font-weight: 900;
}
.set-button-group button.active { background: var(--accent); border-color: var(--accent); color: #233318; }

/* Scouting */
.scouting-layout { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 26vw); gap: 8px; }
.scouting-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr); gap: 8px; }
.court-pair { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.court-slot { min-width: 0; min-height: 0; display: grid; grid-template-rows: 16px minmax(0, 1fr) 16px; justify-items: center; }
.court-axis-label { width: 100%; display: grid; place-items: center; color: var(--muted); font-size: .56rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.court-frame { position: relative; height: 100%; max-height: 100%; aspect-ratio: 1 / 1; max-width: 100%; align-self: center; }
.court {
    width: 100%; height: 100%; display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr);
    border: 3px solid var(--court-line); background: white; user-select: none;
}
.court-cell {
    position: relative; min-width: 0; min-height: 0; padding: 0; border: 0; border-right: 1px solid rgba(52,64,84,.21); border-bottom: 1px solid rgba(52,64,84,.21); background: white; overflow: visible;
}
.court-cell:nth-child(9n) { border-right: 0; }
.court-cell:nth-child(n+73) { border-bottom: 0; }
.cell-number { position: absolute; top: 2px; left: 3px; z-index: 4; color: rgba(52,64,84,.55); font-size: clamp(.38rem, .63vw, .53rem); line-height: 1; font-weight: 750; pointer-events: none; }
.zone-mark { position: absolute; right: 2px; bottom: 2px; z-index: 4; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 5px; display: grid; place-items: center; font-size: .52rem; line-height: 1; font-weight: 950; color: #1A2A1B; pointer-events: none; border: 1px solid rgba(0,0,0,.08); }
.court-cell.zone-visible-q3 { background: linear-gradient(135deg, #F7FFF8 0 55%, var(--q3) 55% 100%); box-shadow: inset 0 0 0 1px rgba(0,155,49,.24); }
.court-cell.zone-visible-q2 { background: linear-gradient(135deg, #FFFFFB 0 55%, var(--q2) 55% 100%); box-shadow: inset 0 0 0 1px rgba(164,196,0,.28); }
.zone-mark.q3 { background: var(--q3); }
.zone-mark.q2 { background: var(--q2); }
.attack-line { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% * 6 / 9); height: 4px; transform: translateY(-2px); background: var(--primary); pointer-events: none; }

.player-token {
    position: absolute; z-index: 8; top: 50%; left: 50%; width: min(72%, 48px); aspect-ratio: 1; transform: translate(-50%, -50%);
    border-radius: 999px; border: 3px solid white; color: white; display: grid; place-items: center; font-size: clamp(.75rem, 1.7vw, 1.25rem); font-weight: 950; box-shadow: 0 2px 7px rgba(16,24,40,.30);
}
.player-token.traffic-green { background: var(--traffic-green); }
.player-token.traffic-yellow { background: var(--traffic-yellow); color: #3D3210; }
.player-token.traffic-red { background: var(--traffic-red); }
.player-token.traffic-neutral { background: var(--traffic-neutral); }
.player-token.selected { outline: 4px solid var(--accent); outline-offset: 1px; transform: translate(-50%, -50%) scale(1.08); }
.court-cell.player-field-green { box-shadow: inset 0 0 0 4px rgba(33,166,87,.68); }
.court-cell.player-field-yellow { box-shadow: inset 0 0 0 4px rgba(240,180,41,.78); }
.court-cell.player-field-red { box-shadow: inset 0 0 0 4px rgba(214,69,69,.72); }
.court-cell.player-field-neutral { box-shadow: inset 0 0 0 3px rgba(122,133,128,.50); }
.court-cell.last-target::after { content: ''; position: absolute; inset: 1px; z-index: 6; border: 3px solid var(--primary); pointer-events: none; }
.court.target-mode .player-token { pointer-events: none; }
.second-court-placeholder {
    width: min(100%, 430px); height: 100%; max-height: 100%; aspect-ratio: 1; align-self: center; display: grid; place-items: center; align-content: center; gap: 5px;
    border: 2px dashed #B8C5BC; border-radius: 8px; background: rgba(255,255,255,.55); color: var(--muted); text-align: center;
}
.second-court-placeholder strong { color: var(--primary-dark); font-size: 1rem; }
.second-court-placeholder span { font-size: .68rem; }
.scouting-side { min-height: 0; display: grid; grid-template-rows: minmax(150px, .9fr) minmax(0, 1.1fr); gap: 8px; }
.side-card { min-width: 0; min-height: 0; background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; overflow: hidden; }
.side-title, .side-title-row { font-size: .78rem; font-weight: 900; }
.side-title-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.side-hint { color: var(--muted); font-size: .6rem; font-weight: 650; }
.receiver-stats { height: calc(100% - 22px); margin-top: 5px; display: grid; align-content: start; gap: 4px; overflow: hidden; }
.receiver-stat-row { min-height: 31px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 7px; border: 1px solid #E6EBE7; background: #FAFBFA; font-size: .68rem; }
.receiver-stat-row.traffic-green { border-left: 6px solid var(--traffic-green); }
.receiver-stat-row.traffic-yellow { border-left: 6px solid var(--traffic-yellow); }
.receiver-stat-row.traffic-red { border-left: 6px solid var(--traffic-red); }
.receiver-stat-row.traffic-neutral { border-left: 6px solid var(--traffic-neutral); }
.receiver-stat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.receiver-stat-points { white-space: nowrap; font-weight: 950; font-size: .72rem; }
.receiver-stat-empty { color: var(--muted); font-size: .68rem; padding: 8px 2px; }
.recent-card { display: flex; flex-direction: column; }
.recent-list { min-height: 0; height: calc(100% - 20px); margin-top: 5px; display: grid; grid-template-rows: repeat(8, minmax(0, 1fr)); gap: 3px; }
.recent-item, .recent-empty { min-height: 0; border: 1px solid #E6EBE7; border-radius: 7px; background: #FAFBFA; padding: 3px 6px; font-size: clamp(.58rem, .92vw, .72rem); }
.recent-item { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.recent-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quality-badge, .quality-dot { display: grid; place-items: center; border-radius: 999px; font-weight: 950; border: 1px solid rgba(16,24,40,.10); }
.quality-badge { flex: 0 0 auto; width: 23px; height: 23px; font-size: .67rem; }
.q3 { background: var(--q3); } .q2 { background: var(--q2); } .q1 { background: var(--q1); } .q0 { background: var(--q0); } .qn { background: var(--qn); }

/* Startaufstellungen */
.lineup-page { height: 100%; min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr) 150px; gap: 8px; }
.lineup-set-grid { min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.lineup-set-card { min-width: 0; min-height: 0; background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 5px; display: grid; grid-template-rows: 28px minmax(0,1fr) 16px; overflow: hidden; }
.lineup-set-head { display: flex; align-items: center; justify-content: space-between; gap: 3px; font-size: .67rem; font-weight: 950; }
.copy-lineup-button { height: 24px; padding: 0 5px; border: 1px solid #C9D3CC; border-radius: 6px; background: #F7F9F7; color: var(--primary-dark); font-size: .55rem; font-weight: 850; white-space: nowrap; }
.mini-rotation { min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); border: 2px solid var(--court-line); background: #F9FBF9; }
.lineup-position-button { min-width: 0; min-height: 0; position: relative; padding: 2px; border: 0; border-right: 1px solid #D5DED8; border-bottom: 1px solid #D5DED8; background: white; display: grid; place-items: center; align-content: center; gap: 2px; }
.lineup-position-button:nth-child(3n) { border-right: 0; }
.lineup-position-button:nth-child(n+4) { border-bottom: 0; }
.lineup-position-button.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 3px var(--accent); }
.lineup-pos-number { position: absolute; top: 2px; left: 3px; font-size: .48rem; font-weight: 900; color: var(--muted); }
.lineup-player-number { font-size: clamp(.72rem, 1.45vw, 1.1rem); font-weight: 950; color: var(--primary-dark); }
.lineup-player-name { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .45rem; color: var(--muted); }
.mini-net-label { align-self: center; text-align: center; color: white; background: var(--primary); border-radius: 0 0 5px 5px; font-size: .52rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.lineup-roster-panel { display: grid; grid-template-rows: 28px minmax(0, 1fr); gap: 5px; }
.lineup-roster-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lineup-roster-controls { display: flex; gap: 4px; }
.lineup-roster-controls .small-action { height: 27px; }
.lineup-roster-buttons { min-height: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0,1fr)); gap: 4px; }
.lineup-player-button { min-width: 0; min-height: 0; border: 1px solid #C9D3CC; border-radius: 7px; background: #F9FBF9; display: grid; place-items: center; align-content: center; padding: 2px; }
.lineup-player-button .num { font-size: .85rem; font-weight: 950; color: var(--primary-dark); }
.lineup-player-button .name { width: 100%; font-size: .48rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.lineup-player-button.used { background: var(--primary-soft); border-color: #A8CCB3; }

/* Mannschaften */
.teams-page { height: 100%; min-height: 0; display: grid; grid-template-rows: 42px 78px 44px minmax(0,1fr); gap: 7px; }
.sync-info { color: var(--muted); font-size: .61rem; white-space: nowrap; }
.team-button-grid { min-height: 0; display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(0,1fr)); gap: 4px; }
.team-button { min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 7px; background: white; padding: 3px 5px; font-size: .58rem; font-weight: 800; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-button.active { background: var(--primary); color: white; border-color: var(--primary); }
.team-edit-bar { display: flex; align-items: center; gap: 6px; padding: 5px 7px; }
.team-name-editor { min-width: 0; flex: 1 1 280px; display: flex; align-items: center; gap: 5px; font-size: .63rem; font-weight: 850; }
.team-name-editor input { min-width: 100px; width: 100%; height: 30px; border: 1px solid var(--border); border-radius: 7px; padding: 0 8px; }
.team-roster-meta { flex: 1 1 auto; min-width: 70px; color: var(--muted); font-size: .58rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-page-info { font-size: .61rem; font-weight: 850; white-space: nowrap; }
.roster-grid { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(3, minmax(0,1fr)); gap: 5px; }
.roster-card { min-width: 0; min-height: 0; background: white; border: 1px solid var(--border); border-radius: 8px; padding: 5px; display: grid; grid-template-rows: 18px minmax(0,1fr) 25px; gap: 4px; overflow: hidden; }
.roster-card-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.roster-source { border-radius: 999px; padding: 1px 6px; font-size: .48rem; font-weight: 900; background: var(--primary-soft); color: var(--primary-dark); }
.roster-source.manual { background: var(--accent-soft); color: #556400; }
.roster-override { color: #A56200; font-size: .48rem; font-weight: 900; white-space: nowrap; }
.roster-input-grid { min-height: 0; display: grid; grid-template-columns: 54px minmax(0,1fr); grid-template-rows: repeat(2, minmax(0,1fr)); gap: 4px; }
.roster-input-grid input { min-width: 0; width: 100%; height: 100%; min-height: 28px; border: 1px solid #D7DED8; border-radius: 6px; padding: 0 6px; font-size: .63rem; }
.roster-number-input { grid-row: 1 / 3; font-size: .82rem !important; font-weight: 950; text-align: center; }
.roster-card-actions { display: flex; justify-content: flex-end; gap: 4px; }
.roster-card-actions button { height: 25px; border-radius: 6px; padding: 0 7px; border: 1px solid var(--border); background: #F8FAF8; font-size: .54rem; font-weight: 850; }
.roster-card-actions .save { background: var(--primary); color: white; border-color: var(--primary); }
.roster-empty { grid-column: 1/-1; display: grid; place-items: center; border: 1px dashed #B9C5BC; border-radius: 10px; background: rgba(255,255,255,.6); color: var(--muted); text-align: center; font-size: .75rem; }

/* Zonen */
.zones-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(180px, 22vw); gap: 8px; }
.court-column { min-height: 0; display: grid; grid-template-rows: 42px 16px minmax(0,1fr) 16px; justify-items: center; gap: 0; }
.zones-frame { max-width: 72vh; }
.zone-palette { display: flex; gap: 3px; }
.zone-palette button { width: 31px; height: 30px; border-radius: 7px; border: 1px solid var(--border); font-size: .72rem; font-weight: 950; }
.zone-palette button[data-quality="3"] { background: var(--q3); }
.zone-palette button[data-quality="2"] { background: var(--q2); }
.zone-palette button[data-quality="1"] { background: var(--q1); }
.zone-palette button[data-quality="0"] { background: var(--q0); }
.zone-palette button[data-quality="null"] { background: var(--qn); }
.zone-palette button.active { outline: 3px solid var(--primary); outline-offset: 1px; }
.zones-court .court-cell.q3 { background: var(--q3); } .zones-court .court-cell.q2 { background: var(--q2); } .zones-court .court-cell.q1 { background: var(--q1); } .zones-court .court-cell.q0 { background: var(--q0); }
.zone-side { display: flex; flex-direction: column; justify-content: space-between; }
.zone-legend { margin-top: 8px; display: grid; gap: 7px; }
.zone-legend > div { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 7px; font-size: .68rem; }
.quality-dot { width: 27px; height: 27px; font-size: .68rem; }
.zone-side-bottom { display: grid; gap: 7px; }
.zone-count { color: var(--muted); font-size: .65rem; line-height: 1.35; }

/* Benutzer */
.users-page { height: 100%; min-height: 0; display: grid; grid-template-rows: 42px 54px minmax(0,1fr); gap: 8px; }
.user-new-bar { display: flex; align-items: end; gap: 8px; padding: 5px 8px; }
.user-new-bar label { display: grid; gap: 2px; flex: 1 1 180px; font-size: .58rem; font-weight: 850; }
.user-new-bar input[type="text"], .user-new-bar input[type="password"], .user-new-bar input:not([type]) { height: 29px; border: 1px solid var(--border); border-radius: 7px; padding: 0 7px; }
.user-check { flex: 0 0 auto !important; display: flex !important; align-items: center; gap: 5px; height: 30px; }
.users-grid { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(0,1fr)); gap: 6px; }
.user-card { min-width: 0; min-height: 0; background: white; border: 1px solid var(--border); border-radius: 9px; padding: 7px; display: grid; align-content: start; gap: 5px; font-size: .65rem; }
.user-card-title { font-weight: 950; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card label { display: flex; align-items: center; gap: 5px; }
.user-card input[type="password"] { width: 100%; height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; font-size: .62rem; }
.user-card button { height: 27px; border: 1px solid var(--primary); border-radius: 6px; background: var(--primary); color: white; font-size: .58rem; font-weight: 850; }

/* Modals */
.modal-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 14px; background: rgba(13,29,18,.42); backdrop-filter: blur(3px); }
.modal-card { width: min(900px, 94vw); max-height: 88dvh; background: white; border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.22); overflow: hidden; }
.modal-head { height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-close { width: 31px; height: 31px; border: 0; border-radius: 8px; background: #EFF3F0; color: var(--ink); font-size: 1.2rem; line-height: 1; }
.team-picker-card { height: min(410px, 72dvh); display: grid; grid-template-rows: 34px minmax(0,1fr); }
.team-picker-grid { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(4, minmax(0,1fr)); gap: 7px; }
.team-picker-option { min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 9px; background: #F9FBF9; padding: 7px; font-size: .7rem; font-weight: 850; }
.team-picker-option.active { background: var(--primary); color: white; border-color: var(--primary); }
.receiver-modal-card { height: min(470px, 80dvh); display: grid; grid-template-rows: 34px minmax(0,1fr); }
.receiver-modal-body { min-height: 0; display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 8px; }
.receiver-slot-buttons { display: grid; grid-template-rows: repeat(3,1fr); gap: 7px; }
.receiver-slot-button { border: 1px solid var(--border); border-radius: 9px; background: #F8FAF8; font-weight: 900; }
.receiver-slot-button.active { background: var(--accent); border-color: var(--accent); color: #25351C; }
.receiver-player-buttons { min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); grid-template-rows: repeat(4, minmax(0,1fr)); gap: 6px; }
.receiver-player-button { min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 8px; background: #FAFBFA; display: grid; place-items: center; align-content: center; gap: 2px; padding: 3px; }
.receiver-player-button .num { font-size: .95rem; font-weight: 950; color: var(--primary-dark); }
.receiver-player-button .name { width: 100%; font-size: .52rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.add-player-card { width: min(560px, 92vw); display: grid; gap: 10px; }
.modal-form-grid { display: grid; grid-template-columns: 100px minmax(0,1fr) minmax(150px,.7fr); gap: 8px; }
.modal-form-grid label { display: grid; gap: 3px; font-size: .63rem; font-weight: 850; }
.modal-form-grid input { height: 38px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; }

.toast { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(680px, 90vw); padding: 9px 13px; border-radius: 999px; background: #172019; color: white; font-size: .72rem; font-weight: 750; box-shadow: 0 10px 30px rgba(0,0,0,.24); transition: .18s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
    :root { --nav-h: 48px; }
    .brand { font-size: .68rem; }
    .nav-button { padding: 0 6px; font-size: .59rem; }
    .logout-button { font-size: .58rem; padding: 0 6px; }
    .scouting-layout { grid-template-columns: minmax(0,1fr) 205px; }
    .toolbar-note { display: none; }
    .team-current-button { max-width: 190px; }
    .lineup-roster-buttons { grid-template-columns: repeat(10, minmax(0,1fr)); }
    .team-button-grid { grid-template-columns: repeat(8,minmax(0,1fr)); }
}

@media (max-height: 650px) {
    .lineup-page { grid-template-rows: 42px minmax(0,1fr) 124px; }
    .lineup-roster-panel { padding: 5px; }
    .roster-card { padding: 3px; }
    .teams-page { grid-template-rows: 42px 68px 40px minmax(0,1fr); }
}
