: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); }
}

/* 0.7.0 – Spiele, Offline/PWA, Vollbild und Listenansicht */
.top-actions { display: flex; align-items: center; gap: 5px; padding-top: 3px; white-space: nowrap; }
.sync-status { height: 28px; padding: 0 7px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px; color: white; border: 1px solid rgba(255,255,255,.30); background: rgba(0,0,0,.08); font-size: .58rem; font-weight: 850; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #D9E0DC; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.sync-status.online .sync-dot { background: #B9F3C8; }
.sync-status.offline .sync-dot { background: #FFD44D; }
.sync-status.pending .sync-dot { background: #FFD44D; animation: syncPulse 1.1s infinite alternate; }
@keyframes syncPulse { from { opacity: .45; } to { opacity: 1; } }
.fullscreen-button { width: 33px; height: 32px; border: 1px solid rgba(255,255,255,.38); border-radius: 7px; background: rgba(255,255,255,.10); color: white; font-size: 1rem; font-weight: 950; line-height: 1; }
.team-current-button.locked { cursor: default; border-color: #83B493; background: #DCEFE2; }
.danger-action { height: 32px; border: 1px solid #C73535; border-radius: 8px; padding: 0 11px; background: #D94343; color: white; font-size: .7rem; font-weight: 900; white-space: nowrap; }

/* Spiele */
.games-page { height: 100%; min-height: 0; display: grid; grid-template-rows: 42px 62px minmax(0,1fr) minmax(96px,.42fr); gap: 8px; }
.active-game-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(120px,.5fr) max-content; align-items: center; gap: 8px; padding: 8px 10px; }
.active-game-card > strong { font-size: .8rem; }
.active-game-card > span { color: var(--muted); font-size: .66rem; }
.active-game-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 950; }
.active-game-meta { color: var(--muted); font-size: .64rem; text-align: right; white-space: nowrap; }
.game-create { min-height: 0; display: grid; grid-template-rows: 27px minmax(0,1fr) 42px; gap: 6px; }
.game-create-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .76rem; }
.game-team-buttons { min-height: 0; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); gap: 5px; }
.game-team-button { min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--ink); padding: 4px 6px; font-size: .59rem; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-team-button.active { background: var(--primary); color: white; border-color: var(--primary); }
.game-team-button:disabled { opacity: .58; }
.game-fields { display: grid; grid-template-columns: minmax(180px,1.2fr) 145px minmax(180px,1fr) max-content; align-items: end; gap: 6px; }
.game-fields label { min-width: 0; display: grid; gap: 2px; color: var(--muted); font-size: .55rem; font-weight: 850; }
.game-fields input { min-width: 0; width: 100%; height: 31px; border: 1px solid var(--border); border-radius: 7px; padding: 0 7px; background: white; color: var(--ink); font-size: .67rem; }
.game-history { display: grid; grid-template-rows: 22px minmax(0,1fr); }
.game-history-list { min-height: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); gap: 4px; }
.game-history-row { min-width: 0; min-height: 0; border: 1px solid #E4EAE6; border-radius: 7px; background: #FAFBFA; padding: 4px 6px; display: grid; align-content: center; gap: 2px; }
.game-history-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .6rem; }
.game-history-row span, .game-history-empty { color: var(--muted); font-size: .55rem; }
.game-history-empty { grid-column: 1/-1; display: grid; place-items: center; }

/* Die 2er-/3er-Zonen sind bewusst vollflächig. */
:root { --q3: #62C96F; --q2: #F4DF43; --q1: #F4A63A; --q0: #E65A50; }
.court-cell.zone-visible-q3 { background: var(--q3); box-shadow: inset 0 0 0 1px rgba(0,100,30,.28); }
.court-cell.zone-visible-q2 { background: var(--q2); box-shadow: inset 0 0 0 1px rgba(110,95,0,.22); }
.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); }

/* Spielerinnenfelder: kontinuierliche Ampelfarbe statt drei harter Stufen. */
.court-cell.player-field-green,
.court-cell.player-field-yellow,
.court-cell.player-field-red,
.court-cell.player-field-neutral { background: var(--player-quality-soft, rgba(122,133,128,.25)); box-shadow: inset 0 0 0 4px var(--player-quality-color, #7A8580); }
.player-token { transition: background-color .18s ease, transform .12s ease; }

/* Annahmestatistik mit Prozent und fließender Farbleiste. */
.receiver-stat-row { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 5px; gap: 4px; border-left: 6px solid var(--stat-color, var(--traffic-neutral)) !important; }
.receiver-stat-top { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; }
.receiver-stat-bar { height: 5px; border-radius: 999px; background: #E7ECE8; overflow: hidden; }
.receiver-stat-bar span { display: block; height: 100%; border-radius: inherit; transition: width .2s ease, background-color .2s ease; }
.receiver-stat-points { font-size: .65rem; }

/* Mannschaftskader als kompakte Liste statt Karten. */
.roster-grid { min-height: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: repeat(16,minmax(0,1fr)); gap: 2px; }
.roster-row { min-width: 0; min-height: 0; display: grid; grid-template-columns: 38px 55px minmax(180px,1fr) 68px 42px 100px; align-items: center; gap: 5px; padding: 2px 5px; border: 1px solid #E1E7E2; border-radius: 6px; background: white; overflow: hidden; }
.roster-row input { min-width: 0; width: 100%; height: 100%; max-height: 29px; border: 1px solid #D7DED8; border-radius: 5px; padding: 0 6px; background: #FCFDFC; font-size: .62rem; }
.roster-list-number { text-align: center; font-weight: 950; }
.roster-list-position { text-align: center; text-transform: uppercase; font-weight: 900; }
.roster-change-state { color: #A56200; font-size: .5rem; font-weight: 850; text-align: center; }
.roster-list-actions { display: flex; justify-content: flex-end; gap: 3px; }
.roster-list-actions button { height: 25px; border-radius: 5px; padding: 0 6px; border: 1px solid var(--border); background: #F8FAF8; font-size: .52rem; font-weight: 850; }
.roster-list-actions button.save { border-color: var(--primary); background: var(--primary); color: white; }
.roster-empty { grid-row: 1/-1; }

@media (max-width: 1180px) {
    .top-nav { grid-template-columns: minmax(0,1fr) max-content; }
    .brand { display: none; }
    .nav-buttons { justify-content: flex-start; }
    .nav-button { padding: 0 6px; font-size: .58rem; }
    .sync-status { padding: 0 5px; font-size: .52rem; }
    .game-team-buttons { grid-template-columns: repeat(7,minmax(0,1fr)); }
}

@media (max-width: 900px) {
    .sync-status { width: 10px; padding: 0; border: 0; background: transparent; }
    .sync-status #syncStatusText, #syncStatusText { display: none; }
    .game-fields { grid-template-columns: minmax(140px,1fr) 128px minmax(120px,.8fr) max-content; }
    .roster-row { grid-template-columns: 28px 46px minmax(120px,1fr) 55px 32px 86px; gap: 3px; padding: 1px 3px; }
}


/* 0.7.1 – Fehler-Doppelfeld unter 76/77, jenseits des Netzes. */
.scouting-court-frame {
    height: 90%;
    align-self: start;
    overflow: visible;
}
.reception-error-button {
    position: absolute;
    z-index: 12;
    top: calc(100% + 2px);
    left: calc(100% * 3 / 9);
    width: calc(100% * 2 / 9);
    height: calc(100% / 9);
    min-width: 0;
    min-height: 0;
    padding: 0 4px;
    border: 3px solid #D93025;
    border-radius: 4px;
    background: #FFF1F0;
    color: #C5221F;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, .5vw, 7px);
    box-shadow: 0 2px 5px rgba(120, 20, 20, .14);
    font-weight: 950;
    cursor: pointer;
    touch-action: manipulation;
}
.reception-error-button .error-cross {
    font-size: clamp(1.15rem, 2.8vw, 2.3rem);
    line-height: .8;
    font-weight: 950;
}
.reception-error-button .error-label {
    font-size: clamp(.42rem, .72vw, .62rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}
.reception-error-button.armed {
    background: #FFE0DE;
    border-color: #C5221F;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, .18), 0 2px 5px rgba(120, 20, 20, .14);
}
.reception-error-button.last-error {
    background: #D93025;
    color: #FFFFFF;
    border-color: #A61B14;
    transform: scale(1.03);
}
.reception-error-button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* 0.7.2 – feste quadratische Volleyballfelder und Schnellzuweisung Startaufstellung */
:root {
    --scouting-court-size: 295px;
    --scouting-pair-width: 598px;
    --lineup-court-size: 128px;
    --lineup-card-width: 142px;
}

/* Volleyballfelder dürfen niemals verzerrt werden. */
.court-frame,
.zones-frame,
.scouting-court-frame,
.second-court-placeholder,
.mini-rotation {
    aspect-ratio: 1 / 1;
}

/* Scouting: zwei feste, gleich große Felder nebeneinander – kein Umbruch, kein Stretching. */
.scouting-layout {
    grid-template-columns: var(--scouting-pair-width) minmax(130px, 1fr);
    min-width: calc(var(--scouting-pair-width) + 138px);
    align-items: start;
}
.scouting-main {
    width: var(--scouting-pair-width);
    min-width: var(--scouting-pair-width);
    grid-template-rows: 42px auto;
    align-content: start;
}
.court-pair {
    width: var(--scouting-pair-width);
    min-width: var(--scouting-pair-width);
    grid-template-columns: repeat(2, var(--scouting-court-size));
    grid-auto-flow: column;
    gap: 8px;
    align-items: start;
    justify-content: start;
    overflow: visible;
}
.court-slot {
    width: var(--scouting-court-size);
    min-width: var(--scouting-court-size);
    max-width: var(--scouting-court-size);
    height: calc(var(--scouting-court-size) + 84px);
    min-height: calc(var(--scouting-court-size) + 84px);
    grid-template-rows: 16px var(--scouting-court-size) 68px;
    align-content: start;
    justify-items: stretch;
}
.scouting-court-frame {
    width: var(--scouting-court-size);
    height: var(--scouting-court-size);
    min-width: var(--scouting-court-size);
    min-height: var(--scouting-court-size);
    max-width: var(--scouting-court-size);
    max-height: var(--scouting-court-size);
    align-self: start;
    overflow: visible;
}
.scouting-court-frame .court,
.second-court-placeholder {
    width: var(--scouting-court-size);
    height: var(--scouting-court-size);
    min-width: var(--scouting-court-size);
    min-height: var(--scouting-court-size);
    max-width: var(--scouting-court-size);
    max-height: var(--scouting-court-size);
}
.second-court-placeholder {
    align-self: start;
    border-radius: 0;
}
.scouting-side {
    min-width: 130px;
}

/* Auch die Zonenverwaltung bleibt exakt quadratisch. */
.zones-frame {
    width: min(100%, 68dvh);
    height: auto;
    max-width: 68dvh;
    max-height: 68dvh;
    align-self: center;
}
.zones-frame .court {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

/* Startaufstellungen: fünf feste quadratische Volleyballfelder gleichzeitig. */
.lineup-page {
    grid-template-rows: 42px 182px minmax(178px, 1fr);
}
.lineup-set-grid {
    grid-template-columns: repeat(5, var(--lineup-card-width));
    grid-auto-flow: column;
    justify-content: start;
    align-items: start;
    gap: 6px;
    overflow: hidden;
}
.lineup-set-card {
    width: var(--lineup-card-width);
    min-width: var(--lineup-card-width);
    height: 182px;
    min-height: 182px;
    grid-template-rows: 28px var(--lineup-court-size) 16px;
    align-content: start;
    padding: 5px;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.lineup-set-card.active-set {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 2px rgba(0,155,49,.16);
}
.lineup-set-select {
    min-width: 0;
    height: 24px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: .67rem;
    font-weight: 950;
}
.active-set .lineup-set-select {
    color: var(--primary-dark);
}
.mini-rotation {
    width: var(--lineup-court-size);
    height: var(--lineup-court-size);
    min-width: var(--lineup-court-size);
    min-height: var(--lineup-court-size);
    max-width: var(--lineup-court-size);
    max-height: var(--lineup-court-size);
    justify-self: center;
    align-self: start;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    align-content: center;
    overflow: hidden;
}
.lineup-position-button {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
}
.mini-net-label {
    align-self: center;
    text-align: center;
    white-space: nowrap;
}

/* Kader in der Startaufstellung als kompakte Klick-Liste statt Kartenraster. */
.lineup-roster-panel {
    min-height: 0;
    grid-template-rows: 28px minmax(0,1fr);
}
.lineup-roster-head {
    min-height: 28px;
}
.lineup-roster-buttons {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    grid-template-rows: repeat(10, minmax(0,1fr));
    grid-auto-flow: column;
    gap: 2px 5px;
    overflow: hidden;
}
.lineup-player-button {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #DCE4DE;
    border-radius: 5px;
    background: #FCFDFC;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) 30px;
    align-items: center;
    gap: 5px;
    padding: 1px 6px;
    text-align: left;
}
.lineup-player-button .num {
    font-size: .63rem;
    text-align: right;
    font-weight: 950;
    color: var(--primary-dark);
}
.lineup-player-button .name {
    font-size: .6rem;
    color: var(--ink);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lineup-player-button .pos {
    font-size: .55rem;
    color: var(--muted);
    font-weight: 900;
    text-align: center;
}
.lineup-player-button.used {
    background: var(--primary-soft);
    border-color: #A8CCB3;
}
.lineup-roster-controls #lineupPrevPage,
.lineup-roster-controls #lineupNextPage {
    display: none !important;
}

@media (max-width: 900px) {
    /* Keine responsive Umordnung der beiden Scoutingfelder. */
    .scouting-layout {
        grid-template-columns: var(--scouting-pair-width) minmax(130px, 1fr);
    }
    .court-pair {
        grid-template-columns: repeat(2, var(--scouting-court-size));
    }
    .lineup-set-grid {
        grid-template-columns: repeat(5, var(--lineup-card-width));
    }
}


/* 0.7.3 – Scouting dauerhaft 80 % Feldbereich / max. 20 % Statistik.
   Keine Breakpoints dürfen dieses Verhältnis oder die zweispaltige Feldanordnung ändern. */
:root {
    --scouting-layout-gap: 8px;
    --scouting-layout-half-gap: 4px;
}

.scouting-layout {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, calc(80% - var(--scouting-layout-half-gap))) minmax(0, calc(20% - var(--scouting-layout-half-gap)));
    gap: var(--scouting-layout-gap);
    align-items: start;
}

.scouting-main {
    width: 100%;
    min-width: 0;
}

.court-pair {
    width: 100%;
    min-width: 0;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column;
    gap: 8px;
    align-items: start;
    justify-content: stretch;
}

.court-slot {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    grid-template-rows: 16px auto 68px;
}

.scouting-court-frame,
.scouting-court-frame .court,
.second-court-placeholder {
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    aspect-ratio: 1 / 1;
}

.scouting-court-frame {
    align-self: start;
}

.second-court-placeholder {
    align-self: start;
}

.scouting-side {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1180px), (max-width: 900px) {
    .scouting-layout {
        grid-template-columns: minmax(0, calc(80% - var(--scouting-layout-half-gap))) minmax(0, calc(20% - var(--scouting-layout-half-gap)));
    }
    .court-pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 0.8.0 – Scouting/Angriff, Startaufstellung und iPad-Vollbild */
:root {
    --lineup-court-size-v080: 154px; /* +20 % gegenüber 128 px */
    --lineup-active-court-size-v080: 308px; /* aktueller Satz doppelte Kantenlänge */
}

/* iPad: app-eigener Vollbildmodus statt nativer Fullscreen-UI mit System-X. */
html.app-focus-mode,
html.app-focus-mode body,
html.app-focus-mode .app {
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
}
html.app-focus-mode body { position: fixed; inset: 0; }

/* Scouting bleibt 80/20. Die beiden Volleyballfelder sind immer exakt gleich groß und quadratisch. */
.scouting-layout {
    grid-template-columns: minmax(0, calc(80% - 4px)) minmax(0, calc(20% - 4px)) !important;
    gap: 8px !important;
    align-items: start;
}
.scouting-main { width: 100% !important; min-width: 0 !important; }
.court-pair {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: start;
    overflow: visible !important;
}
.court-slot {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 20px auto auto auto !important;
    align-content: start;
    justify-items: stretch;
}
.court-title-label {
    font-size: .72rem;
    color: var(--primary-dark);
    letter-spacing: .06em;
}
.scouting-court-frame,
.attack-court-frame,
.scouting-court-frame .court,
.attack-court-frame .court {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 1 / 1 !important;
    align-self: start !important;
    overflow: visible;
}

/* Neun quadratische Angriffs-Startfelder über dem rechten Court; links identischer Spacer. */
.attack-entry-row,
.attack-entry-spacer,
.court-extension-row {
    width: 100%;
    aspect-ratio: 9 / 1;
    min-height: 0;
}
.attack-entry-row,
.court-extension-row {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
}
.attack-entry-cell {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-top: 2px solid var(--court-line);
    border-bottom: 2px solid var(--court-line);
    border-right: 1px solid rgba(52,64,84,.10);
    background: #F8FAF8;
}
.attack-entry-cell:first-child { border-left: 2px solid var(--court-line); }
.attack-entry-cell:last-child { border-right: 2px solid var(--court-line); }
.attack-entry-cell:active { background: var(--primary-soft); }

/* Interne 1×1-m-Linien bewusst sehr zurückhaltend; Feldnummern bleiben nur intern/ARIA erhalten. */
.court-cell {
    border-right-color: rgba(52,64,84,.085) !important;
    border-bottom-color: rgba(52,64,84,.085) !important;
}
.cell-number { display: none !important; }
.court-cell.noninteractive { cursor: default; pointer-events: none; }

/* Annahme: 3-m-Linie unten; Angriff: gedreht, 3-m-Linie oben. */
.reception-attack-line { top: calc(100% * 6 / 9) !important; }
.attack-line-top { top: calc(100% * 3 / 9) !important; }

/* Fehlerfeld liegt in einer eigenen Zeile unter Spalte 4/5 – keine Überlagerung mehr. */
.reception-error-button {
    position: static !important;
    grid-column: 4 / span 2;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    padding: 1px 2px !important;
    border: 2px solid #D93025 !important;
    border-radius: 3px !important;
    background: #FFF1F0;
    color: #C5221F;
    display: grid !important;
    grid-template-rows: 1fr auto;
    place-items: center;
    align-content: center;
    gap: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}
.reception-error-button .error-cross {
    align-self: end;
    font-size: clamp(1.35rem, 2.4vw, 2.2rem) !important;
    line-height: .8;
    font-weight: 950;
}
.reception-error-button .error-label {
    align-self: start;
    font-size: clamp(.5rem, .8vw, .72rem) !important;
    line-height: 1;
    text-transform: uppercase;
    font-weight: 950;
    white-space: nowrap;
}
.reception-error-button.last-error { background: #D93025; color: #fff; }

/* Spielerinnen auf dem Annahmefeld: kein Kreis mehr, nur große gut lesbare Trikotnummer. */
.player-token {
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    transform: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #102018 !important;
    font-size: clamp(1.35rem, 3.0vw, 2.65rem) !important;
    line-height: 1;
    font-weight: 1000;
    text-shadow: 0 1px 0 rgba(255,255,255,.9), 1px 0 0 rgba(255,255,255,.75), -1px 0 0 rgba(255,255,255,.75);
}
.player-token.selected {
    outline: 4px solid var(--accent) !important;
    outline-offset: -4px !important;
    transform: none !important;
}

/* Annahmequalität: Nummer und Statistik größer, Name immer in eigener zweiter Zeile. */
.receiver-stats { gap: 6px; }
.receiver-stat-row {
    min-height: 58px;
    grid-template-rows: auto auto 7px !important;
    gap: 2px !important;
    padding: 5px 7px;
}
.receiver-stat-summary {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: baseline;
    gap: 8px;
}
.receiver-stat-number {
    font-size: clamp(1.15rem, 1.9vw, 1.65rem);
    line-height: 1;
    font-weight: 1000;
    color: var(--primary-dark);
}
.receiver-stat-points {
    justify-self: end;
    font-size: clamp(.82rem, 1.2vw, 1.02rem) !important;
    line-height: 1;
    font-weight: 1000;
}
.receiver-stat-name {
    width: 100%;
    font-size: clamp(.67rem, .95vw, .82rem) !important;
    line-height: 1.1;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.receiver-stat-bar { height: 7px !important; }
.quality-badge { width: 29px; height: 29px; font-size: .86rem; }
.recent-item, .recent-empty { font-size: clamp(.68rem, 1vw, .82rem); }
.set-button-group button { font-size: .86rem; }

/* Startaufstellung: Body aus fünf Courts links + schmaler vertikaler Spielerliste rechts. */
.lineup-page {
    grid-template-rows: 42px minmax(0,1fr) !important;
    gap: 8px;
}
.lineup-workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) 270px;
    gap: 8px;
    overflow: hidden;
}
.lineup-toolbar-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.danger-outline { border-color: #D65353 !important; color: #A82B2B !important; background: #FFF7F7 !important; }
.lineup-set-grid {
    min-width: 0;
    min-height: 0;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    overflow: hidden !important;
}
.lineup-set-card {
    width: calc(var(--lineup-court-size-v080) + 12px) !important;
    min-width: calc(var(--lineup-court-size-v080) + 12px) !important;
    height: calc(var(--lineup-court-size-v080) + 42px) !important;
    min-height: calc(var(--lineup-court-size-v080) + 42px) !important;
    grid-template-rows: 28px var(--lineup-court-size-v080) 8px !important;
    padding: 5px !important;
    transition: width .16s ease, height .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.lineup-set-card.active-set {
    width: calc(var(--lineup-active-court-size-v080) + 12px) !important;
    min-width: calc(var(--lineup-active-court-size-v080) + 12px) !important;
    height: calc(var(--lineup-active-court-size-v080) + 42px) !important;
    min-height: calc(var(--lineup-active-court-size-v080) + 42px) !important;
    grid-template-rows: 28px var(--lineup-active-court-size-v080) 8px !important;
}
.mini-rotation {
    width: var(--lineup-court-size-v080) !important;
    height: var(--lineup-court-size-v080) !important;
    min-width: var(--lineup-court-size-v080) !important;
    min-height: var(--lineup-court-size-v080) !important;
    max-width: var(--lineup-court-size-v080) !important;
    max-height: var(--lineup-court-size-v080) !important;
    aspect-ratio: 1 / 1 !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
}
.active-set .mini-rotation {
    width: var(--lineup-active-court-size-v080) !important;
    height: var(--lineup-active-court-size-v080) !important;
    min-width: var(--lineup-active-court-size-v080) !important;
    min-height: var(--lineup-active-court-size-v080) !important;
    max-width: var(--lineup-active-court-size-v080) !important;
    max-height: var(--lineup-active-court-size-v080) !important;
}
.lineup-position-button { aspect-ratio: 1 / 1 !important; }
.lineup-pos-number { font-size: .62rem !important; top: 3px; left: 4px; }
.lineup-player-number { font-size: 1.2rem !important; line-height: 1; }
.lineup-player-name { font-size: .57rem !important; }
.active-set .lineup-pos-number { font-size: .82rem !important; }
.active-set .lineup-player-number { font-size: 2rem !important; }
.active-set .lineup-player-name { font-size: .78rem !important; }
.mini-net-label {
    height: 8px !important;
    min-height: 8px !important;
    background: var(--primary) !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    border-radius: 0 0 4px 4px;
}

/* Spielerinnen in der Startaufstellung: eine einzige schmale, vertikale Klickliste. */
.lineup-roster-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-rows: 34px minmax(0,1fr) !important;
    padding: 6px !important;
}
.lineup-roster-buttons {
    min-height: 0;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    overflow: hidden !important;
}
.lineup-player-button {
    flex: 0 0 31px;
    width: 100%;
    min-height: 31px;
    height: 31px;
    display: grid !important;
    grid-template-columns: 46px minmax(0,1fr) 34px !important;
    align-items: center;
    gap: 6px !important;
    padding: 1px 6px !important;
}
.lineup-player-button .num {
    font-size: 1rem !important;
    line-height: 1;
    text-align: right;
}
.lineup-player-button .name {
    font-size: .72rem !important;
    text-align: left;
}
.lineup-player-button .pos { font-size: .62rem !important; }

/* Auch in Modalen und Listen sind Trikot-/Qualitätszahlen besser lesbar. */
.receiver-player-button .num { font-size: 1.2rem !important; }
.roster-list-number { font-size: .78rem !important; }
.zone-palette button { font-size: .86rem !important; }
.quality-dot { font-size: .78rem !important; }

@media (max-width: 1180px) {
    /* 80/20 und zwei Courts bleiben bestehen; Startaufstellung wird nur bei Bedarf proportional begrenzt. */
    .scouting-layout { grid-template-columns: minmax(0, calc(80% - 4px)) minmax(0, calc(20% - 4px)) !important; }
    .court-pair { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
    .lineup-workspace { grid-template-columns: minmax(0,1fr) 235px; }
}
.zone-mark { min-width: 20px; height: 20px; font-size: .7rem; }

/* 0.9.0 – freie Koordinaten / freie Qualitätszonen / Angriff */
.scouting-main {
    display: grid !important;
    grid-template-rows: 42px auto auto !important;
    align-content: start;
    gap: 8px !important;
    overflow: visible !important;
}
.continuous-courts { align-items: start !important; overflow: visible !important; }
.continuous-court-frame { position: relative !important; overflow: visible !important; }
.continuous-court { position: relative; z-index: 1; cursor: crosshair; }
.continuous-court .court-cell.noninteractive { pointer-events: auto !important; cursor: crosshair !important; background: transparent; }
.continuous-court .court-cell { position: relative; z-index: 1; }
.continuous-court .player-token { pointer-events: auto !important; z-index: 5; cursor: pointer; }
.court-zone-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}
.free-zone-shape { stroke-width: 4; vector-effect: non-scaling-stroke; }
.free-zone-q3 { fill: rgba(47, 190, 77, .58); stroke: rgba(28, 143, 51, .72); }
.free-zone-q2 { fill: rgba(255, 221, 45, .72); stroke: rgba(204, 169, 0, .72); }
.free-zone-q1 { fill: rgba(242, 145, 35, .40); stroke: rgba(196, 101, 9, .62); }
.target-marker {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    z-index: 8;
    pointer-events: none;
    background: #111;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.target-marker.attack-marker { background: #005a27; }

/* X sowie 2-Sekunden-Qualitätskorrektur unter dem Feld. */
.quality-action-row {
    width: 100%;
    min-height: 48px;
    height: 48px;
    aspect-ratio: auto !important;
    display: grid !important;
    grid-template-columns: repeat(9, minmax(0,1fr));
    align-items: center;
    overflow: visible;
}
.reception-error-button.icon-only-error {
    grid-column: 4 / span 2 !important;
    height: 44px !important;
    display: grid !important;
    place-items: center !important;
    grid-template-rows: 1fr !important;
    background: #fff1f0 !important;
}
.reception-error-button.icon-only-error .error-cross {
    align-self: center !important;
    font-size: clamp(2rem, 3vw, 3rem) !important;
    line-height: 1 !important;
}
.quality-override {
    grid-column: 6 / span 4;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    padding-left: 6px;
    white-space: nowrap;
    font-size: .66rem;
    font-weight: 850;
}
.quality-override[hidden] { display: none !important; }
.quality-override button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 1000;
}
.quality-override button[data-quality="1"] { background: #f4a340; }
.quality-override button[data-quality="2"] { background: #ffe23e; }
.quality-override button[data-quality="3"] { background: #58c96a; }
.attack-quality-row .quality-override { grid-column: 6 / span 4; }

/* Angriff: Quelle oben, Ziel frei; roter AUS-Streifen liegt außerhalb und verändert die Courtgröße nicht. */
.attack-entry-cell.active {
    background: var(--accent) !important;
    box-shadow: inset 0 0 0 3px var(--primary-dark);
}
.attack-target-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: visible;
}
.attack-target-wrapper > .attack-court-frame { width: 100% !important; height: 100% !important; }
.attack-out-strip {
    position: absolute;
    z-index: 12;
    border: 1px solid rgba(201, 50, 41, .55);
    background: rgba(226, 70, 57, .14);
    cursor: crosshair;
}
.attack-out-strip:hover, .attack-out-strip:active { background: rgba(226,70,57,.28); }
.attack-out-left { right: 100%; top: 0; width: 22px; height: 100%; }
.attack-out-right { left: 100%; top: 0; width: 22px; height: 100%; }
.attack-out-bottom { top: 100%; left: 0; width: 100%; height: 22px; }

.scouting-side {
    grid-template-rows: minmax(145px,1fr) minmax(145px,1fr) !important;
    align-self: stretch;
}
.attack-stats-card { min-height: 0; }
.scouting-raw-row {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    min-width: 0;
    margin-top: 2px;
}
.raw-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(255,255,255,.82);
    padding: 5px 7px;
}
.raw-head { display:flex; align-items:center; justify-content:space-between; gap:6px; font-size:.65rem; }
.raw-head span { color:var(--muted); font-size:.58rem; }
.compact-recent {
    height: auto !important;
    min-height: 36px !important;
    margin-top: 4px !important;
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-template-rows: none !important;
    gap: 3px !important;
    overflow: hidden;
}
.recent-item.compact { min-height: 27px; height: 27px; padding:2px 5px; font-size:.59rem; }
.recent-item.compact .quality-badge { width:22px; height:22px; font-size:.65rem; }

/* Freier SVG-Zoneneditor */
.free-zones-layout { grid-template-columns:minmax(0,1fr) minmax(210px,20vw) !important; }
.zone-editor-column { min-height:0; display:grid; grid-template-rows:42px 48px minmax(0,1fr); gap:7px; }
.zone-context-buttons, .zone-tool-buttons { display:flex; gap:4px; }
.zone-context-buttons button, .zone-tool-buttons button {
    min-height: 30px; padding: 3px 9px; border:1px solid var(--border); border-radius:7px; background:#fff; font-size:.69rem; font-weight:850;
}
.zone-context-buttons button.active, .zone-tool-buttons button.active { background:var(--primary-soft); border-color:var(--primary); color:var(--primary-dark); }
.zone-editor-tools { display:flex; align-items:center; gap:7px; padding:5px 7px; overflow:hidden; }
.zone-palette button.q3 { background:#58c96a !important; }
.zone-palette button.q2 { background:#ffe23e !important; }
.zone-palette button.q1 { background:#f4a340 !important; }
.zone-editor-shell { min-height:0; display:grid; place-items:start center; overflow:hidden; }
.zone-editor-court {
    width:min(100%, calc(100dvh - 185px));
    max-width:100%;
    aspect-ratio:1/1;
    position:relative;
    border:3px solid var(--court-line);
    background-color:#fff;
    background-image:
        linear-gradient(to right, rgba(52,64,84,.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(52,64,84,.08) 1px, transparent 1px);
    background-size:calc(100% / 9) calc(100% / 9);
    touch-action:none;
}
.zone-editor-svg { position:absolute; inset:0; width:100%; height:100%; touch-action:none; overflow:visible; }
.zone-editor-netline { top:calc(100% * 6 / 9) !important; z-index:8; pointer-events:none; }
.editable-zone { pointer-events:all; cursor:grab; }
.editable-zone.selected { stroke:#073f1e; stroke-width:8; filter:drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.zone-handle { fill:#fff; stroke:#083f20; stroke-width:7; vector-effect:non-scaling-stroke; pointer-events:all; cursor:grab; }
.polygon-draft { fill:none; stroke:#083f20; stroke-width:7; stroke-dasharray:18 12; vector-effect:non-scaling-stroke; pointer-events:none; }
.zone-help { font-size:.68rem; line-height:1.35; color:var(--muted); }
.free-zone-legend .quality-dot { width:20px; height:20px; border-radius:5px; }
.free-zone-legend .quality-dot.q3 { background:#58c96a; }
.free-zone-legend .quality-dot.q2 { background:#ffe23e; }
.free-zone-legend .quality-dot.q1 { background:#f4a340; }
.free-zone-legend .quality-dot.qn { background:#fff; border:1px solid var(--border); }
.attack-player-buttons { max-height:65dvh; overflow:auto; }

@media (max-width: 1180px) {
    .compact-recent { grid-template-columns: 1fr !important; }
    .quality-override span { display:none; }
}

/* 0.9.0 – Startaufstellungen nach Spielstand gruppiert + Zuspielerin */
.lineup-set-grid {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    overflow: hidden !important;
}
.lineup-set-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: start;
    gap: 5px;
}
.lineup-stage-label {
    padding-top: 7px;
    color: var(--muted);
    font-size: .61rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    writing-mode: horizontal-tb;
}
.lineup-stage-current .lineup-stage-label { color: var(--primary-dark); }
.lineup-stage-cards {
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 7px;
    overflow: hidden;
}
.lineup-stage-played .lineup-set-card,
.lineup-stage-future .lineup-set-card {
    opacity: .94;
}
.lineup-stage-current .lineup-set-card {
    opacity: 1;
}
.lineup-position-button {
    position: relative;
}
.lineup-position-button.setter-player {
    box-shadow: inset 0 0 0 4px #1976D2 !important;
    background: #EEF6FF !important;
    border-color: #1976D2 !important;
}
.active-set .lineup-position-button.setter-player {
    box-shadow: inset 0 0 0 6px #1976D2 !important;
}
.lineup-setter-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 4;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #1976D2;
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.active-set .lineup-setter-badge {
    min-width: 24px;
    height: 24px;
    font-size: .78rem;
}
.lineup-position-button.setter-selectable {
    cursor: pointer;
    outline: 2px dashed #1976D2;
    outline-offset: -5px;
}
.setter-action.active {
    background: #1976D2 !important;
    border-color: #1976D2 !important;
    color: #fff !important;
}

/* Die Qualitätszonen selbst bleiben reine Farbflächen – keine Ziffern im Court. */
.court-zone-overlay text,
.zone-editor-svg text { display: none !important; }

/* --------------------------------------------------------------------------
   0.9.1 final layout corrections
   -------------------------------------------------------------------------- */

/* Scouting: zwei 9x9-Hälften bilden zusammen ein 18x9-Volleyballfeld. */
.combined-volleyball-court {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
    align-items: start !important;
    overflow: visible !important;
    padding: 0 16px 34px 0;
    box-sizing: border-box;
}
.combined-volleyball-court .court-slot {
    display: grid !important;
    grid-template-rows: 20px auto 48px !important;
    gap: 0 !important;
    min-width: 0 !important;
}
.combined-volleyball-court .reception-court-slot { padding-right: 0; }
.combined-volleyball-court .attack-court-slot { padding-left: 0; }
.combined-volleyball-court .continuous-court-frame,
.combined-volleyball-court .attack-target-wrapper {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    min-width: 0 !important;
}
.combined-volleyball-court .reception-court-frame {
    border-right-width: 4px !important;
    border-radius: 0 !important;
}
.combined-volleyball-court .attack-court-frame {
    border-left-width: 4px !important;
    border-radius: 0 !important;
}
/* Nach 90° gegen den Uhrzeigersinn liegen die 3-m-Linien vertikal. */
.combined-volleyball-court .reception-attack-line,
.combined-volleyball-court .attack-line-top {
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    width: 4px !important;
    transform: none !important;
}
.combined-volleyball-court .reception-attack-line { left: calc(100% * 6 / 9) !important; }
.combined-volleyball-court .attack-line-top { left: calc(100% * 3 / 9) !important; }
.combined-volleyball-court .court-title-label {
    font-size: .75rem;
    letter-spacing: .08em;
    text-align: center;
}
/* Angriff-AUS darf nie über das Annahmefeld ragen. */
.combined-volleyball-court .attack-out-left { display: none !important; }
.combined-volleyball-court .attack-out-right { width: 14px !important; left: 100% !important; }
.combined-volleyball-court .attack-out-bottom { height: 14px !important; top: 100% !important; }
.attack-entry-row,
.attack-entry-spacer { display: none !important; }

/* Automatische Annahmeaufstellung: sechs frei positionierte Spielerinnen. */
.continuous-court { position: relative !important; }
.formation-player-token {
    position: absolute;
    z-index: 12;
    transform: translate(-50%, -50%);
    min-width: 0;
    width: clamp(38px, 4.1vw, 58px);
    height: clamp(38px, 4.1vw, 58px);
    padding: 0 3px;
    border-radius: 8px;
    border: 4px solid var(--player-quality-color, #7a8580);
    background:
        linear-gradient(var(--player-quality-soft, rgba(122,133,128,.18)), var(--player-quality-soft, rgba(122,133,128,.18))),
        #fff;
    color: #102018;
    font-size: clamp(1.55rem, 2.6vw, 2.5rem);
    line-height: 1;
    font-weight: 1000;
    box-shadow: 0 2px 7px rgba(0,0,0,.16);
    cursor: pointer;
}
.formation-player-token.selected { outline: 4px solid #111; outline-offset: 2px; }
.formation-player-token.setter-on-court { box-shadow: 0 0 0 4px #1976d2, 0 2px 7px rgba(0,0,0,.16); }

/* Fehler-X nur als großes Symbol. */
.reception-error-button.icon-only-error { border-radius: 8px !important; }
.reception-error-button.icon-only-error .error-cross { font-size: clamp(2.4rem, 3.4vw, 3.5rem) !important; }

/* Statistiken: Anzahl Aktionen + Prozent, größere Ziffern. */
.receiver-stat-summary { grid-template-columns: minmax(38px, auto) 1fr !important; }
.receiver-stat-number { font-size: clamp(1.22rem, 1.8vw, 1.7rem) !important; }
.receiver-stat-points { font-size: clamp(.82rem, 1.1vw, 1rem) !important; }
.receiver-stat-name { font-size: clamp(.72rem, .95vw, .88rem) !important; }

/* Je Rohdatenliste maximal 12 Einträge, dreispaltig und innerhalb der Karte scrollbar. */
.scouting-raw-row { min-height: 86px; max-height: 112px; }
.raw-card { min-height: 0; overflow: hidden; display: grid; grid-template-rows: 20px minmax(0,1fr); }
.compact-recent {
    min-height: 0 !important;
    height: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 27px !important;
    align-content: start;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.recent-item.compact { min-width: 0; }
.recent-item.compact .recent-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) {
    .compact-recent { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* Zoneneditor: immer ein deutlich sichtbares quadratisches Annahmefeld. */
.free-zones-layout { grid-template-columns: minmax(0, 1fr) 240px !important; }
.zone-editor-column { min-height: 0; grid-template-rows: 42px 48px minmax(0,1fr) !important; }
.zone-editor-shell {
    width: 100%;
    min-height: 0;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 4px;
}
.zone-editor-court {
    width: min(68dvh, 72vw, 760px) !important;
    min-width: min(420px, 78vw) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    flex: 0 0 auto;
}
/* Wie im gedrehten Annahmefeld: 3-m-Linie vertikal. */
.zone-editor-netline {
    top: 0 !important;
    bottom: 0 !important;
    left: calc(100% * 6 / 9) !important;
    width: 4px !important;
    height: 100% !important;
}

/* Startaufstellungen kompakter: aktuell ca. 20 % kleiner, offene deutlich kleiner. */
:root {
    --lineup-played-court-v091: 126px;
    --lineup-future-court-v091: 112px;
    --lineup-current-court-v091: 246px;
}
.lineup-workspace { grid-template-columns: minmax(0, 1fr) 360px !important; }
.lineup-roster-panel { min-width: 340px !important; }
.lineup-player-button { grid-template-columns: 48px minmax(0,1fr) 38px !important; }
.lineup-player-button .name { font-size: .78rem !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-stage-played .lineup-set-card {
    width: calc(var(--lineup-played-court-v091) + 12px) !important;
    min-width: calc(var(--lineup-played-court-v091) + 12px) !important;
    height: auto !important;
}
.lineup-stage-played .mini-rotation {
    width: var(--lineup-played-court-v091) !important;
    height: var(--lineup-played-court-v091) !important;
    min-width: var(--lineup-played-court-v091) !important;
    min-height: var(--lineup-played-court-v091) !important;
}
.lineup-stage-future .lineup-set-card {
    width: calc(var(--lineup-future-court-v091) + 12px) !important;
    min-width: calc(var(--lineup-future-court-v091) + 12px) !important;
    height: auto !important;
}
.lineup-stage-future .mini-rotation {
    width: var(--lineup-future-court-v091) !important;
    height: var(--lineup-future-court-v091) !important;
    min-width: var(--lineup-future-court-v091) !important;
    min-height: var(--lineup-future-court-v091) !important;
}
.lineup-stage-current .lineup-set-card {
    width: calc(var(--lineup-current-court-v091) + 12px) !important;
    min-width: calc(var(--lineup-current-court-v091) + 12px) !important;
    height: auto !important;
}
.lineup-stage-current .mini-rotation {
    width: var(--lineup-current-court-v091) !important;
    height: var(--lineup-current-court-v091) !important;
    min-width: var(--lineup-current-court-v091) !important;
    min-height: var(--lineup-current-court-v091) !important;
}
.lineup-inline-rotate {
    margin-left: auto;
    width: 31px;
    height: 27px;
    padding: 0;
    border: 1px solid var(--primary);
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 1000;
}
.lineup-variant-choice {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    font-size: .58rem;
}
.lineup-variant-choice > span { color: var(--muted); font-weight: 800; }
.lineup-variant-choice button {
    min-height: 24px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font-size: .58rem;
    font-weight: 800;
}
.lineup-variant-choice button.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
/* In gespielten/offenen Sätzen reicht der blaue Rahmen; kein Z-Badge. */
.lineup-stage-played .lineup-setter-badge,
.lineup-stage-future .lineup-setter-badge { display: none !important; }

/* Einstellungen → Annahmeaufstellungsvarianten. */
.settings-page { height: 100%; min-height: 0; display: grid; grid-template-rows: 42px minmax(0,1fr); gap: 8px; }
.reception-variant-settings {
    min-height: 0;
    display: grid;
    grid-template-columns: 220px minmax(0,1fr);
    gap: 8px;
}
.variant-sidebar { min-height: 0; display: grid; grid-template-rows: 28px minmax(0,1fr) 34px; gap: 5px; }
.variant-buttons { min-height: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.variant-select-button {
    width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff; text-align: left; font-weight: 850;
}
.variant-select-button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.variant-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.variant-editor { min-height: 0; display: grid; grid-template-rows: 42px minmax(0,1fr); gap: 6px; overflow: hidden; }
.variant-editor-head { display: grid; grid-template-columns: minmax(180px,260px) 1fr auto; gap: 8px; align-items: end; }
.variant-editor-head label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px; font-size: .66rem; font-weight: 800; }
.variant-editor-head input { min-height: 30px; border:1px solid var(--border); border-radius:7px; padding:3px 7px; }
.reception-variant-courts {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    grid-template-rows: repeat(2, minmax(0,1fr));
    gap: 8px;
    overflow: hidden;
}
.variant-template-card { min-height: 0; display: grid; grid-template-rows: 24px minmax(0,1fr); justify-items: center; }
.variant-template-title { width:100%; font-size:.7rem; font-weight:900; color:var(--primary-dark); }
.variant-template-court {
    position: relative;
    height: 100%;
    max-height: 31dvh;
    aspect-ratio: 1 / 1;
    border: 3px solid var(--court-line);
    background-color: #fff;
    background-image:
        linear-gradient(to right, rgba(52,64,84,.055) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(52,64,84,.055) 1px, transparent 1px);
    background-size: calc(100% / 9) calc(100% / 9);
    touch-action: none;
}
.variant-template-net { position:absolute; left:0; right:0; bottom:0; height:5px; background:var(--primary); pointer-events:none; }
.variant-position-marker {
    position:absolute;
    transform:translate(-50%,-50%);
    width:34px; height:34px;
    border-radius:50%;
    border:3px solid var(--primary-dark);
    background:#fff;
    color:var(--primary-dark);
    font-size:.9rem;
    font-weight:1000;
    touch-action:none;
    box-shadow:0 1px 4px rgba(0,0,0,.18);
}
.variant-position-marker.setter-marker { border-color:#1976d2; box-shadow:0 0 0 3px rgba(25,118,210,.22); color:#0d5fb1; }

/* iPad-App-Vollbild: genug Sicherheitsabstand für fremde Browser-Overlays. */
html.app-focus-mode .top-nav { padding-left: max(10px, env(safe-area-inset-left)) !important; padding-top: max(4px, env(safe-area-inset-top)) !important; }

/* --------------------------------------------------------------------------
   0.10.0 – Spielstand, Handlungskette und kompakteres Gesamtfeld
   -------------------------------------------------------------------------- */

/* Das zusammenhängende 18x9-Feld wird etwas kleiner, damit rundherum Platz bleibt. */
.combined-volleyball-court {
    width: min(92%, calc((100dvh - 205px) * 2)) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding-right: 20px !important;
    padding-bottom: 34px !important;
}
.combined-volleyball-court .court-slot { min-width: 0 !important; }

/* Qualitätszonen bewusst hinter den Spielerinnen und deutlich blasser. */
.court-zone-overlay {
    z-index: 2 !important;
    opacity: .52 !important;
}
.court-zone-overlay .free-zone-shape { opacity: .56 !important; }
.formation-player-token,
.continuous-court .player-token { z-index: 20 !important; }
.free-zone-q3 { fill: rgba(74, 193, 94, .32) !important; stroke: rgba(26, 139, 48, .48) !important; }
.free-zone-q2 { fill: rgba(255, 220, 50, .34) !important; stroke: rgba(189, 153, 0, .50) !important; }
.free-zone-q1 { fill: rgba(239, 149, 53, .24) !important; stroke: rgba(191, 100, 15, .42) !important; }

/* Schraffur bleibt sichtbar, wird aber heller als in 0.9.1. */
.court-zone-overlay pattern rect { opacity: .48 !important; }
.court-zone-overlay pattern line { opacity: .10 !important; }

/* Startpunkt des Angriffs auf der linken Hälfte. */
.attack-source-marker {
    background: #1976d2 !important;
    width: 20px !important;
    height: 20px !important;
    margin: -10px 0 0 -10px !important;
    box-shadow: 0 0 0 3px rgba(25,118,210,.24), 0 1px 4px rgba(0,0,0,.3) !important;
    z-index: 22 !important;
}

/* AUS-Bereich nur außerhalb der rechten Zielhälfte, ohne Überlappung der linken Hälfte. */
.combined-volleyball-court .attack-out-left { display: none !important; }
.combined-volleyball-court .attack-out-top {
    display: block !important;
    left: 0 !important;
    bottom: 100% !important;
    top: auto !important;
    width: 100% !important;
    height: 18px !important;
}
.combined-volleyball-court .attack-out-right {
    display: block !important;
    left: 100% !important;
    top: 0 !important;
    width: 18px !important;
    height: 100% !important;
}
.combined-volleyball-court .attack-out-bottom {
    display: block !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    height: 18px !important;
}
.attack-out-strip { background: rgba(226,70,57,.10) !important; border-color: rgba(201,50,41,.42) !important; }

/* Rechte Spalte: Spielstand oben, Qualitätskarten darunter. */
.scouting-side {
    grid-template-rows: 118px minmax(118px, 1fr) minmax(118px, 1fr) !important;
    gap: 7px !important;
}
.score-card {
    min-height: 0;
    padding: 7px !important;
    display: grid;
    grid-template-rows: 21px minmax(0,1fr) 30px;
    gap: 4px;
    overflow: hidden;
}
.score-card-head { display:flex; align-items:center; justify-content:space-between; gap:6px; font-size:.72rem; }
.score-card-head span { color:var(--muted); font-size:.62rem; font-weight:850; }
.score-board { min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr); align-items:center; gap:3px; }
.score-separator { text-align:center; font-size:1.3rem; font-weight:1000; }
.score-team { min-width:0; display:grid; gap:2px; }
.score-team-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; font-size:.58rem; font-weight:900; color:var(--primary-dark); }
.score-controls { display:grid; grid-template-columns:27px minmax(34px,1fr) 27px; align-items:center; gap:2px; }
.score-controls button {
    width:27px; height:27px; padding:0; border:1px solid var(--border); border-radius:7px; background:#fff; font-size:1.05rem; font-weight:1000;
}
.score-controls strong { text-align:center; font-size:clamp(1.55rem,2.1vw,2.15rem); line-height:1; color:#102018; }
.score-error-buttons { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.score-error-buttons button { min-width:0; height:29px; padding:2px 4px; border:1px solid #e34d42; border-radius:7px; background:#fff2f0; color:#b5261d; font-size:.57rem; font-weight:900; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Rohdaten nur noch sechs Aktionen; kompakt unten. */
.scouting-raw-row { min-height:68px !important; max-height:82px !important; margin-top:0 !important; }
.compact-recent { grid-template-columns:repeat(3,minmax(0,1fr)) !important; grid-auto-rows:26px !important; overflow-y:auto !important; }
.recent-item.compact { height:26px !important; min-height:26px !important; font-size:.56rem !important; }

/* Annahmeaufstellungsvarianten: zusätzlich die 3-m-Linie. */
.variant-template-three-meter {
    position:absolute;
    left:0;
    right:0;
    top:calc(100% * 6 / 9);
    height:4px;
    background:var(--primary);
    opacity:.88;
    pointer-events:none;
    z-index:2;
}
.variant-template-net { z-index:2; }
.variant-position-marker { z-index:4; }

/* Spielerklicks stehen immer über Raster und Qualitätsflächen. */
.formation-player-token { background-color:rgba(255,255,255,.88) !important; }

/* Das eigene App-Vollbild erhält links oben zusätzlichen Sicherheitsraum; native iPad-Vollbild-UI wird nicht verwendet. */
html.app-focus-mode .top-nav { padding-left:max(48px, env(safe-area-inset-left)) !important; }

@media (max-width: 1180px) {
    .combined-volleyball-court { width:min(90%, calc((100dvh - 195px) * 2)) !important; }
    .scouting-side { grid-template-rows:110px minmax(110px,1fr) minmax(110px,1fr) !important; }
}
/* Reserve oberhalb beider Hälften denselben Raum für den oberen Angriff-AUS-Streifen. */
.combined-volleyball-court .reception-court-frame,
.combined-volleyball-court .attack-target-wrapper { margin-top:18px !important; }

/* --------------------------------------------------------------------------
   0.10.1 – Feldflucht, größere Neben-Sätze und kompaktere Namensdarstellung
   -------------------------------------------------------------------------- */

/* Beide Spielfeldhälften beginnen exakt auf derselben Höhe. Der rote obere
   AUS-Streifen des Angriffs liegt außerhalb des Courts und verschiebt ihn nicht. */
.combined-volleyball-court .reception-court-frame,
.combined-volleyball-court .attack-target-wrapper {
    margin-top: 0 !important;
}
.combined-volleyball-court .reception-court-frame,
.combined-volleyball-court .attack-court-frame {
    align-self: start !important;
}
.combined-volleyball-court .attack-out-top {
    bottom: 100% !important;
    top: auto !important;
}

/* Die manuellen Punktfehler liegen direkt unter den jeweiligen 3-Meter-Bereichen
   und nicht mehr in der Spielstandskarte. */
.combined-volleyball-court .court-slot {
    grid-template-rows: 20px auto 48px 30px !important;
}
.manual-error-anchor {
    width: 33.3333%;
    height: 28px;
    display: flex;
    align-items: center;
}
.reception-manual-error-anchor {
    justify-self: end;
    justify-content: flex-end;
}
.attack-manual-error-anchor {
    justify-self: start;
    justify-content: flex-start;
}
.manual-error-anchor button {
    width: 100%;
    min-width: 0;
    height: 27px;
    padding: 1px 5px;
    border: 1px solid #e34d42;
    border-radius: 7px;
    background: #fff2f0;
    color: #b5261d;
    font-size: .58rem;
    font-weight: 900;
    white-space: nowrap;
}
.manual-error-anchor button:disabled { opacity: .42; }
.score-card {
    grid-template-rows: 21px minmax(0,1fr) !important;
}
.score-error-buttons { display: none !important; }

/* Neben-Sätze dürfen die verfügbare Breite deutlich besser ausnutzen. Maximal
   vier Karten stehen in einer Zeile; alle Volleyballfelder bleiben quadratisch. */
:root {
    --lineup-played-court-v101: 205px;
    --lineup-future-court-v101: 205px;
}
.lineup-stage-played .lineup-stage-cards,
.lineup-stage-future .lineup-stage-cards {
    width: 100%;
    display: flex !important;
    gap: 9px !important;
    overflow: hidden !important;
}
.lineup-stage-played .lineup-set-card,
.lineup-stage-future .lineup-set-card {
    flex: 0 1 calc(25% - 7px) !important;
    width: min(var(--lineup-played-court-v101), calc(25% - 7px)) !important;
    min-width: 150px !important;
    max-width: var(--lineup-played-court-v101) !important;
    height: auto !important;
}
.lineup-stage-future .lineup-set-card {
    max-width: var(--lineup-future-court-v101) !important;
}
.lineup-stage-played .mini-rotation,
.lineup-stage-future .mini-rotation {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 1 / 1 !important;
}

/* Positionsziffern sind in der Startaufstellung redundant. */
.lineup-pos-number { display: none !important; }

/* Name im Feld: Nachname gut lesbar, Vorname klein in zweiter Zeile. */
.lineup-position-button {
    padding: 4px 3px !important;
    gap: 2px !important;
    overflow: hidden;
}
.lineup-player-name {
    width: 100% !important;
    min-width: 0;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    overflow: hidden !important;
    text-align: center;
    white-space: normal !important;
    line-height: 1.03 !important;
}
.lineup-player-surname {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .61rem;
    font-weight: 850;
    color: var(--ink);
}
.lineup-player-given {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .48rem;
    font-weight: 650;
    color: var(--muted);
}
.lineup-stage-current .lineup-player-surname {
    font-size: .77rem;
}
.lineup-stage-current .lineup-player-given {
    font-size: .61rem;
}
.lineup-stage-played .lineup-player-number,
.lineup-stage-future .lineup-player-number {
    font-size: 1.35rem !important;
}

@media (max-width: 1180px) {
    :root {
        --lineup-played-court-v101: 178px;
        --lineup-future-court-v101: 178px;
    }
    .lineup-stage-played .lineup-set-card,
    .lineup-stage-future .lineup-set-card {
        min-width: 132px !important;
    }
}

/* Bei nur zwei Satz-Zeilen (Satz 1 bzw. Satz 5) dürfen die maximal vier
   Nebenfelder deutlich größer werden. Bei drei Zeilen werden sie kompakter,
   damit die Seite weiterhin ohne vertikales Scrollen auf das Tablet passt. */
.lineup-layout-two-rows .lineup-stage-played .lineup-set-card,
.lineup-layout-two-rows .lineup-stage-future .lineup-set-card {
    max-width: 225px !important;
    min-width: 168px !important;
}
.lineup-layout-three-rows .lineup-stage-played .lineup-set-card,
.lineup-layout-three-rows .lineup-stage-future .lineup-set-card {
    max-width: 145px !important;
    min-width: 118px !important;
}

/* 18 px Reserve für den oberen roten Angriff-AUS-Streifen, ohne die rechte
   Spielfeldhälfte selbst nach unten zu verschieben. */
.combined-volleyball-court .court-slot {
    grid-template-rows: 38px auto 48px 30px !important;
}
.combined-volleyball-court .court-title-label {
    height: 20px;
    align-self: start;
}

/* 0.12.0 – Spielkader-Teilnahme pro laufendem Spiel. */
.roster-row { grid-template-columns: 38px 55px minmax(180px,1fr) 68px 82px 42px 100px; }
.game-roster-toggle { min-width: 0; height: 25px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 6px; border: 1px solid #C7D4C9; border-radius: 999px; background: #F7FAF7; font-size: .52rem; font-weight: 900; color: #4D5C51; cursor: pointer; user-select: none; }
.game-roster-toggle input { appearance: none; -webkit-appearance: none; width: 28px !important; height: 16px !important; min-width: 28px; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 999px; background: #CDD5CF; position: relative; cursor: pointer; }
.game-roster-toggle input::after { content: ''; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.22); transition: transform .15s ease; }
.game-roster-toggle input:checked { background: var(--primary); }
.game-roster-toggle input:checked::after { transform: translateX(12px); }
.game-roster-toggle input:disabled { opacity: .55; cursor: default; }
.game-roster-toggle:has(input:not(:checked)) { border-color: #E3B4B0; background: #FFF6F5; color: #A8322A; }
@media (max-width: 900px) {
    .roster-row { grid-template-columns: 28px 46px minmax(120px,1fr) 55px 68px 32px 86px; }
    .game-roster-toggle { padding: 0 4px; gap: 3px; font-size: .48rem; }
}

/* --------------------------------------------------------------------------
   0.12.0 – Rally-Pfeile, vollständiger AUS-Rahmen, Auswertung und Detaildialog
   -------------------------------------------------------------------------- */

/* Qualitätszonen bleiben klar hinter den Spielerinnen, aber noch zurückhaltender. */
.court-zone-overlay { z-index: 2 !important; opacity: .38 !important; }
.court-zone-overlay .free-zone-shape { opacity: .42 !important; }
.free-zone-q3 { fill: rgba(74,193,94,.22) !important; stroke: rgba(26,139,48,.38) !important; }
.free-zone-q2 { fill: rgba(255,220,50,.24) !important; stroke: rgba(189,153,0,.40) !important; }
.free-zone-q1 { fill: rgba(239,149,53,.18) !important; stroke: rgba(191,100,15,.34) !important; }
.formation-player-token,
.continuous-court .player-token { z-index: 24 !important; }

/* Vorderspieler (2/3/4) rund, Hinterspieler (1/6/5) quadratisch. */
.formation-player-token.front-row-player { border-radius: 50% !important; }
.formation-player-token.back-row-player { border-radius: 8px !important; }

/* Das zusätzliche weiße Z wird nicht benötigt: blaue Umrandung reicht. */
.lineup-setter-badge { display: none !important; }

/* Rally-Pfeile liegen über Zonen/Raster, aber unter den Spielerinnen. */
.combined-volleyball-court { position: relative !important; }
.rally-arrow-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 16;
}

/* Etwas kleineres Gesamtfeld und genug Abstand für den komplett umlaufenden AUS-Rahmen. */
.combined-volleyball-court {
    width: min(88%, calc((100dvh - 225px) * 2)) !important;
    column-gap: 36px !important;
    padding: 26px 30px 42px 6px !important;
}
.attack-target-wrapper { overflow: visible !important; }
.combined-volleyball-court .attack-out-strip {
    display: block !important;
    background: rgba(226,70,57,.12) !important;
    border: 1px solid rgba(201,50,41,.48) !important;
    z-index: 7 !important;
}
.combined-volleyball-court .attack-out-left {
    display: block !important;
    right: 100% !important;
    left: auto !important;
    top: -24px !important;
    width: 24px !important;
    height: calc(100% + 48px) !important;
}
.combined-volleyball-court .attack-out-top {
    display: block !important;
    left: -24px !important;
    bottom: 100% !important;
    top: auto !important;
    width: calc(100% + 48px) !important;
    height: 24px !important;
}
.combined-volleyball-court .attack-out-right {
    display: block !important;
    left: 100% !important;
    top: -24px !important;
    width: 24px !important;
    height: calc(100% + 48px) !important;
}
.combined-volleyball-court .attack-out-bottom {
    display: block !important;
    left: -24px !important;
    top: 100% !important;
    width: calc(100% + 48px) !important;
    height: 24px !important;
}

/* Fehlerknöpfe zweizeilig: Fehler / Mannschaft. */
.manual-error-anchor { width: 44% !important; height: 37px !important; }
.manual-error-anchor button {
    height: 36px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1.05;
    white-space: normal !important;
    overflow: hidden;
}
.manual-error-anchor button span { font-size: .54rem; font-weight: 850; text-transform: uppercase; letter-spacing: .02em; }
.manual-error-anchor button strong { width: 100%; font-size: .61rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Zwei Reihen mit je drei Rohdaten-Aktionen sind immer vollständig sichtbar. */
.scouting-raw-row { min-height: 88px !important; max-height: 92px !important; }
.compact-recent {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    grid-template-rows: repeat(2,31px) !important;
    grid-auto-rows: 31px !important;
    max-height: 64px !important;
    overflow: hidden !important;
}
.recent-item.compact { height: 31px !important; min-height: 31px !important; }

/* Nicht aktuelle Satzfelder nutzen die verfügbare Breite besser aus. */
.lineup-stage-played .lineup-stage-cards,
.lineup-stage-future .lineup-stage-cards { width: 100% !important; }
.lineup-stage-played .lineup-set-card,
.lineup-stage-future .lineup-set-card,
.lineup-layout-three-rows .lineup-stage-played .lineup-set-card,
.lineup-layout-three-rows .lineup-stage-future .lineup-set-card,
.lineup-layout-two-rows .lineup-stage-played .lineup-set-card,
.lineup-layout-two-rows .lineup-stage-future .lineup-set-card {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 155px !important;
    max-width: 245px !important;
}

/* Detailoverlay für letzte Aktionen. */
.action-detail-card { width: min(430px, calc(100vw - 34px)); }
.action-modal-details { display: grid; gap: 7px; padding: 4px 0 10px; }
.action-modal-details > div { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: #f8faf8; }
.action-modal-details strong { color: var(--muted); font-size: .72rem; }
.action-modal-details span { font-weight: 850; font-size: .82rem; }
.action-modal-actions { display: flex; justify-content: flex-end; }

/* Auswertung: interne Scrollfläche, pro Angreiferin ein Feld, Netz oben. */
.evaluation-page { height: 100%; min-height: 0; display: grid; grid-template-rows: 48px minmax(0,1fr); gap: 7px; }
.evaluation-toolbar { min-width: 0; }
.evaluation-legend { display: flex; align-items: center; gap: 6px; font-size: .63rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.eval-legend-point { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.eval-legend-point.q3 { background:#14963b; }
.eval-legend-point.q12 { background:#d4a900; }
.eval-legend-point.q0 { background:#d83228; }
.evaluation-grid {
    min-height: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    align-content: start;
    gap: 10px;
    padding: 2px 4px 10px 2px;
}
.evaluation-empty { padding: 18px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); background: #fff; }
.evaluation-player-card { min-width: 0; display: grid; grid-template-rows: 39px auto; gap: 5px; padding: 8px; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.evaluation-player-head { min-width:0; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:7px; }
.evaluation-player-head strong { font-size:1.45rem; line-height:1; color:var(--primary-dark); text-align:center; }
.evaluation-player-head span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:900; font-size:.76rem; }
.evaluation-player-head small { color:var(--muted); font-size:.58rem; font-weight:800; }
.evaluation-court-svg { width:100%; aspect-ratio:1/1; display:block; overflow:hidden; border-radius:2px; }
.eval-court-bg { fill:#fbfcfb; stroke:#176b35; stroke-width:12; }
.eval-gridline { stroke:#cfd7d1; stroke-width:3; opacity:.55; }
.eval-three-meter { stroke:#00a43b; stroke-width:10; }
.eval-net { stroke:#0a602d; stroke-width:17; }

@media (max-width: 1180px) {
    .combined-volleyball-court { width:min(86%, calc((100dvh - 230px) * 2)) !important; column-gap:32px !important; }
    .evaluation-grid { grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); }
    .lineup-stage-played .lineup-set-card,
    .lineup-stage-future .lineup-set-card { min-width: 142px !important; max-width: 220px !important; }
}

/* Annahmeaufstellungs-Editor: gleiche Symbolik wie im Scouting. */
.variant-position-marker[data-rotation="2"],
.variant-position-marker[data-rotation="3"],
.variant-position-marker[data-rotation="4"] { border-radius: 50% !important; }
.variant-position-marker[data-rotation="1"],
.variant-position-marker[data-rotation="5"],
.variant-position-marker[data-rotation="6"] { border-radius: 8px !important; }

/* --------------------------------------------------------------------------
   0.13.0 final – K1/K2 und präzise Angriff-Aus-Geometrie
   -------------------------------------------------------------------------- */
.no-k1-button {
    min-width: 108px;
    height: 34px;
    border: 1px solid #bf7b00;
    border-radius: 9px;
    background: #fff5d8;
    color: #7b4d00;
    font-weight: 950;
    font-size: .72rem;
    white-space: nowrap;
}
.no-k1-button:not(:disabled):active { transform: translateY(1px); }

.runner-position-badge {
    position: absolute;
    left: 6px;
    top: 6px;
    z-index: 28;
    min-width: 34px;
    height: 28px;
    padding: 0 7px;
    border: 2px solid #08742d;
    border-radius: 7px;
    background: rgba(255,255,255,.92);
    color: #08742d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    line-height: 1;
    font-weight: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,.11);
    pointer-events: none;
}

/* AUS nur oben/rechts/unten. Am Netz (linke Kante) niemals rot. */
.combined-volleyball-court .attack-out-left { display: none !important; }
.combined-volleyball-court .attack-out-strip {
    --attack-out-size: 31px;
    background: #fde9e7 !important;
    border-color: #ef8b82 !important;
    opacity: 1 !important;
}
.combined-volleyball-court .attack-out-top {
    left: 0 !important;
    bottom: 100% !important;
    top: auto !important;
    width: calc(100% + var(--attack-out-size)) !important;
    height: var(--attack-out-size) !important;
}
.combined-volleyball-court .attack-out-right {
    left: 100% !important;
    top: 0 !important;
    width: var(--attack-out-size) !important;
    height: calc(100% + var(--attack-out-size)) !important;
}
.combined-volleyball-court .attack-out-bottom {
    left: 0 !important;
    top: 100% !important;
    width: calc(100% + var(--attack-out-size)) !important;
    height: var(--attack-out-size) !important;
}
/* Die überlappenden Eckflächen sind deckend und daher optisch exakt gleich hell. */
.combined-volleyball-court { padding-right: 42px !important; padding-bottom: 50px !important; }

.evaluation-toolbar-actions { display:flex; align-items:center; gap:12px; min-width:0; }
.evaluation-phase-filter { display:flex; gap:4px; }
.evaluation-phase-filter button {
    height:30px; min-width:44px; padding:0 10px; border:1px solid var(--border);
    border-radius:8px; background:#fff; font-size:.64rem; font-weight:900; color:var(--text);
}
.evaluation-phase-filter button.active { background:#e7f6ec; border-color:#0a8b35; color:#08742d; box-shadow: inset 0 0 0 1px #0a8b35; }
.evaluation-court-svg { aspect-ratio: 1000 / 1140 !important; overflow: visible !important; }
.eval-source-cell { fill:#f6f8f6; stroke:#cfd7d1; stroke-width:2; }

/* Editor-Symbolik: Vorderspieler mit sehr leichter grauer Füllung. */
.variant-position-marker[data-rotation="2"],
.variant-position-marker[data-rotation="3"],
.variant-position-marker[data-rotation="4"] { background:#f0f2f0 !important; }
.variant-position-marker[data-rotation="1"],
.variant-position-marker[data-rotation="5"],
.variant-position-marker[data-rotation="6"] { background:#fff !important; }

/* 0.13.0 – Spielverwaltung / Einstellungen / gekoppelte Aufstellungen */
.game-history-button { width:100%; text-align:left; cursor:pointer; }
.game-history-row small { color:var(--muted); font-size:.55rem; font-weight:750; }
.game-manage-card { width:min(620px,calc(100vw - 32px)); }
.game-manage-fields { margin:4px 0 12px; }
.game-manage-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.game-delete-confirm { margin-top:12px; padding:12px; border:1px solid #e89a94; border-radius:10px; background:#fff3f2; display:grid; gap:7px; }
.game-delete-confirm[hidden] { display:none !important; }
.game-delete-confirm > span { color:#7a3b37; font-size:.7rem; }
.game-delete-confirm > div { display:flex; justify-content:flex-end; gap:8px; }
.settings-toolbar { gap:12px; }
.settings-default-opponent { display:flex; align-items:end; gap:6px; margin-left:auto; }
.settings-default-opponent label { display:grid; gap:2px; font-size:.55rem; font-weight:850; color:var(--muted); }
.settings-default-opponent input { width:190px; height:31px; }
.variant-formation-mode { display:inline-flex; gap:4px; padding:3px; border:1px solid var(--border); border-radius:9px; background:#f5f8f5; }
.variant-formation-mode button { height:30px; min-width:76px; border:1px solid transparent; border-radius:7px; background:transparent; font-size:.68rem; font-weight:900; }
.variant-formation-mode button.active { background:#fff; border-color:#0a8b35; color:#08742d; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.variant-quick-button { min-height:44px !important; font-size:.8rem !important; }
.roster-row.readonly { opacity:.88; background:#f7f8f7; }
.roster-row.readonly input { background:#f1f3f1; color:#485149; }
.readonly-hint { color:var(--muted); font-size:.55rem; font-weight:850; }
.team-button.game-team::after { content:' • Spiel'; font-size:.48rem; color:#08742d; }

/* Variantenwahl des aktuellen Satzes rechts neben dem großen Feld. */
.lineup-set-card.active-set { position:relative; overflow:visible !important; }
.lineup-set-card.active-set .lineup-variant-choice {
    position:absolute;
    left:calc(100% + 14px);
    top:44px;
    width:220px;
    max-height:calc(100% - 54px);
    overflow:auto;
    display:flex !important;
    flex-direction:column;
    align-items:stretch;
    gap:5px;
    padding:8px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#fff;
    box-shadow:0 2px 8px rgba(0,0,0,.07);
    z-index:8;
}
.lineup-set-card.active-set .lineup-variant-choice > span { font-size:.58rem; color:var(--muted); font-weight:900; }
.lineup-set-card.active-set .lineup-variant-choice button { min-height:31px; white-space:normal; text-align:left; }

@media (max-width: 1150px) {
    .lineup-set-card.active-set .lineup-variant-choice { width:180px; left:calc(100% + 8px); }
    .settings-default-opponent input { width:150px; }
}

/* --------------------------------------------------------------------------
   0.14.0 final – Programmeinstellungen, Live-Anzeige und kompakte Tablet-UI
   -------------------------------------------------------------------------- */

/* Einstellungen: eigenes zweites Navigationsniveau. */
.settings-subnav {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border: 1px solid #bdd8c4;
    border-radius: 10px;
    background: #e8f4eb;
    overflow-x: auto;
    scrollbar-width: none;
}
.settings-subnav::-webkit-scrollbar { display:none; }
.settings-subnav button {
    flex: 0 0 auto;
    height: 29px;
    padding: 0 11px;
    border: 1px solid #a9cdb2;
    border-radius: 8px;
    background: #f8fcf9;
    color: #235e35;
    font-size: .65rem;
    font-weight: 900;
    white-space: nowrap;
}
.settings-subnav button.active { background:#087b31; color:#fff; border-color:#087b31; }
.program-settings-page {
    height: 100%; min-height: 0;
    display: grid;
    grid-template-rows: 38px 44px minmax(0,1fr);
    gap: 8px;
}
.program-settings-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
    align-content: start;
}
.program-mode-card, .program-default-card, .realtime-info-card { min-height: 135px; display:grid; align-content:start; gap:10px; }
.program-mode-buttons { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.program-mode-buttons button {
    height: 48px; border:2px solid var(--border); border-radius:10px; background:#fff;
    font-size:.9rem; font-weight:950; color:var(--ink);
}
.program-mode-buttons button.active { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-dark); box-shadow:inset 0 0 0 1px var(--primary); }
.program-mode-hint, .realtime-info-card p { margin:0; color:var(--muted); font-size:.7rem; line-height:1.35; }
.realtime-status { display:inline-flex; align-items:center; min-height:28px; width:max-content; max-width:100%; padding:0 9px; border-radius:999px; background:#e8f5eb; color:#08742d; font-size:.64rem; font-weight:900; }
.realtime-status[data-mode="offline"] { background:#f4eeee; color:#9b322c; }
.realtime-status[data-mode="waiting"] { background:#fff5da; color:#876100; }
.program-default-card .settings-default-opponent { margin:0; align-items:end; }
.program-default-card .settings-default-opponent label { flex:1; }
.program-default-card .settings-default-opponent input { width:100%; }

/* Ansichtsversion: nur Scouting, Auswertung und Programmeinstellungen. */
.view-only-mode #view-scouting .scouting-toolbar .toolbar-actions,
.view-only-mode #view-scouting .court-bottom-actions,
.view-only-mode #view-scouting .score-controls,
.view-only-mode #view-scouting .formation-player-token,
.view-only-mode #view-scouting .continuous-court,
.view-only-mode #view-scouting .attack-out-strip {
    pointer-events: none !important;
}
.view-only-mode #view-scouting .scouting-toolbar .toolbar-actions,
.view-only-mode #view-scouting .court-bottom-actions { opacity:.42; }

/* Die beiden Feldhälften bilden optisch wieder ein einziges Feld: keine Lücke am Netz. */
.combined-volleyball-court {
    column-gap: 0 !important;
    padding-top: 34px !important;
}
.combined-volleyball-court .court-slot { grid-template-rows: 0 auto 42px !important; }
.combined-volleyball-court .court-title-label { display:none !important; }
.combined-volleyball-court .reception-court-frame,
.combined-volleyball-court .attack-target-wrapper { margin-top:0 !important; }
.combined-volleyball-court .reception-court-frame { border-right-width:3px !important; }
.combined-volleyball-court .attack-court-frame { border-left-width:0 !important; }

/* Angriff-AUS ausschließlich oben, rechts und unten. Keine rote Kante am Netz. */
.combined-volleyball-court .attack-out-left { display:none !important; }
.combined-volleyball-court .attack-out-strip { --attack-out-size:31px; background:#fde9e7 !important; border:1px solid #ef8b82 !important; opacity:1 !important; }
.combined-volleyball-court .attack-out-top { left:0 !important; width:calc(100% + var(--attack-out-size)) !important; height:var(--attack-out-size) !important; }
.combined-volleyball-court .attack-out-right { left:100% !important; top:0 !important; width:var(--attack-out-size) !important; height:calc(100% + var(--attack-out-size)) !important; }
.combined-volleyball-court .attack-out-bottom { left:0 !important; top:100% !important; width:calc(100% + var(--attack-out-size)) !important; height:var(--attack-out-size) !important; }

/* Alle Aktionen unter dem Feld liegen auf exakt derselben Höhe. */
.court-bottom-actions {
    min-width:0;
    height:38px;
    display:flex;
    align-items:center;
    gap:6px;
    overflow:visible;
    padding-top:4px;
}
.reception-bottom-actions { justify-content:flex-start; }
.attack-bottom-actions { justify-content:flex-end; }
.reception-error-button,
.manual-team-error-button {
    flex:0 0 31%;
    height:34px !important;
    min-width:0;
    border:1px solid #e34d42;
    border-radius:8px;
    background:#fff2f0;
    color:#b5261d;
    font-size:.61rem;
    font-weight:950;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    line-height:1.05;
    overflow:hidden;
}
.manual-team-error-button { flex-direction:column; }
.manual-team-error-button span { font-size:.5rem; text-transform:uppercase; }
.manual-team-error-button strong { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.58rem; }
.reception-error-button span { font-size:.62rem; font-weight:950; }
.no-k1-button { height:34px; flex:0 0 auto; }
.quality-override {
    position:static !important;
    height:34px !important;
    min-height:34px !important;
    display:flex;
    align-items:center;
    gap:4px;
    padding:2px 4px !important;
    border-radius:8px;
    background:#fff;
    box-shadow:0 1px 4px rgba(0,0,0,.08);
    z-index:30;
}
.quality-override[hidden] { display:none !important; }
.quality-override span { font-size:.52rem; }
.quality-override button { width:28px !important; height:28px !important; min-width:28px; padding:0 !important; }
.attack-bottom-actions .quality-override { margin-right:auto; }
.attack-bottom-actions .manual-team-error-button { flex-basis:38%; }

/* Annahmezonen bewusst blass und hinter sämtlichen Spielerinnen. */
.court-zone-overlay { opacity:.30 !important; z-index:2 !important; }
.court-zone-overlay .free-zone-shape { opacity:.34 !important; }
.free-zone-q3 { fill:rgba(74,193,94,.20) !important; stroke:rgba(26,139,48,.35) !important; }
.free-zone-q2 { fill:rgba(255,220,50,.22) !important; stroke:rgba(189,153,0,.36) !important; }
.formation-player-token { z-index:24 !important; }
.formation-player-token.formation-movable { cursor:grab !important; touch-action:none; }
.formation-player-token.formation-movable:active { cursor:grabbing !important; }

/* Startaufstellungen: keine unnötigen vertikalen Leerflächen; 3x2-Spielerblock. */
.lineup-set-card,
.lineup-set-card.active-set,
.lineup-stage-played .lineup-set-card,
.lineup-stage-future .lineup-set-card,
.lineup-stage-current .lineup-set-card {
    height:auto !important;
    min-height:0 !important;
    grid-template-rows:32px auto 7px !important;
    align-self:start !important;
}
.lineup-stage-current .lineup-set-card { width:min(390px, 100%) !important; min-width:300px !important; }
.lineup-stage-current .mini-rotation {
    width:100% !important; height:auto !important; min-width:0 !important; min-height:0 !important;
    max-width:none !important; max-height:none !important; aspect-ratio:3 / 2 !important;
}
.lineup-stage-played .mini-rotation,
.lineup-stage-future .mini-rotation {
    width:100% !important; height:auto !important; min-width:0 !important; min-height:0 !important;
    max-width:none !important; max-height:none !important; aspect-ratio:3 / 2 !important;
}
.lineup-position-button { aspect-ratio:auto !important; min-height:0 !important; }
.lineup-stage-current .lineup-position-button { padding:4px 3px !important; }
.lineup-stage-played .lineup-set-card,
.lineup-stage-future .lineup-set-card { max-width:260px !important; min-width:170px !important; }
.lineup-player-name { white-space:normal !important; }

/* Auswertung: gleiche Pfeilstärke, mehr Raum für echte AUS-Ziele und kompakter Kartenkopf. */
.evaluation-player-card { grid-template-rows:58px auto !important; }
.evaluation-player-head-0140 { display:grid !important; grid-template-columns:1fr !important; grid-template-rows:27px 25px !important; gap:1px !important; }
.eval-head-top { display:grid; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:7px; min-width:0; }
.eval-head-top > strong { font-size:1.45rem; color:var(--primary-dark); text-align:center; }
.eval-head-top > span { overflow:visible !important; text-overflow:clip !important; white-space:nowrap; font-size:.67rem; font-weight:850; color:var(--muted); }
.eval-head-top > b { white-space:nowrap; font-size:.78rem; color:var(--primary-dark); }
.eval-player-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.82rem; font-weight:950; padding-left:3px; }
.evaluation-court-svg { overflow:visible !important; aspect-ratio:1280 / 1360 !important; }

/* Native Vollbild-UI kann links oben eigene Bedienelemente einblenden. */
html.native-fullscreen-safe .top-nav { padding-left:max(74px, env(safe-area-inset-left)) !important; }
html.native-fullscreen-safe .version-stamp { left:max(74px, env(safe-area-inset-left)) !important; }

@media (max-width: 1180px) {
    .program-settings-grid { grid-template-columns:1fr 1fr; }
    .lineup-stage-current .lineup-set-card { min-width:270px !important; }
    .reception-error-button, .manual-team-error-button { flex-basis:29%; }
}

/* --------------------------------------------------------------------------
   0.14.1 – kompakter Spielstart, stabile Aktionsleiste und editierbare Aktionen
   -------------------------------------------------------------------------- */

/* Spiele: Nach dem zusätzlichen Einstellungs-Untermenü gibt es fünf echte Zeilen.
   Keine flexible Zeile darf die Mannschaftsauswahl künstlich auf Seitenhöhe ziehen. */
.games-page {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 38px 42px 54px auto minmax(110px, 1fr) !important;
    gap: 7px !important;
    overflow: hidden !important;
}
.games-page > .view-toolbar { min-height: 0 !important; height: 42px !important; }
.active-game-card {
    min-height: 0 !important;
    height: 54px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto auto !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 6px 9px !important;
    overflow: hidden !important;
}
.active-game-card > strong,
.active-game-card > span { min-width: 0; }
.active-game-card > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-game-card .small-action,
.active-game-card .danger-action { height: 30px !important; }
.game-create {
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-rows: 24px auto 39px !important;
    gap: 6px !important;
    padding: 7px 9px !important;
    align-content: start !important;
    overflow: visible !important;
}
.game-create-head { min-height: 0 !important; height: 24px !important; }
.game-team-buttons {
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-rows: 32px !important;
    gap: 5px !important;
    align-content: start !important;
}
.game-team-button {
    height: 32px !important;
    min-height: 32px !important;
    padding: 3px 7px !important;
    border-radius: 7px !important;
    font-size: .58rem !important;
}
.game-fields {
    min-height: 0 !important;
    height: 39px !important;
    display: grid !important;
    grid-template-columns: minmax(165px, 1.15fr) 132px minmax(150px, .9fr) max-content !important;
    gap: 6px !important;
    align-items: end !important;
}
.game-fields label { gap: 1px !important; }
.game-fields input { height: 29px !important; }
.game-fields .primary-action { height: 29px !important; align-self: end !important; }
.game-history {
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 7px 9px !important;
}
.game-history-list {
    min-height: 0 !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(42px, 1fr) !important;
    overflow-y: auto !important;
}

/* Qualitätskarten: kompakt und ohne rote/orange/grüne Fortschrittsbalken. */
.stats-card { min-height: 0 !important; overflow: hidden !important; }
.receiver-stats { gap: 4px !important; overflow-y: auto !important; }
.receiver-stat-row {
    min-height: 42px !important;
    height: auto !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    grid-template-columns: 1fr !important;
    gap: 1px !important;
    padding: 4px 6px !important;
}
.receiver-stat-summary { min-height: 19px; }
.receiver-stat-number { font-size: clamp(1.03rem, 1.45vw, 1.32rem) !important; }
.receiver-stat-points { font-size: clamp(.66rem, .9vw, .82rem) !important; }
.receiver-stat-name { font-size: clamp(.61rem, .78vw, .72rem) !important; }
.receiver-stat-bar { display: none !important; }

/* Fehler- und Qualitätsbedienung unter beiden Courts: feste, getrennte Zellen. */
.court-bottom-actions {
    height: 40px !important;
    min-height: 40px !important;
    display: grid !important;
    align-items: center !important;
    gap: 5px !important;
    overflow: visible !important;
    padding-top: 4px !important;
}
.reception-bottom-actions { grid-template-columns: minmax(96px, 1fr) minmax(126px, 1.45fr) minmax(96px, 1fr) !important; }
.attack-bottom-actions { grid-template-columns: minmax(0, 1fr) minmax(112px, .75fr) !important; }
.court-action-center {
    min-width: 0;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: visible;
}
.attack-action-center { justify-content: flex-start; }
.reception-error-button,
.manual-team-error-button {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 34px !important;
    flex: none !important;
}
.quality-override {
    flex: 0 1 auto !important;
    max-width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
}
.quality-override button { width: 27px !important; min-width: 27px !important; height: 27px !important; }
.no-k1-button { flex: 0 0 auto !important; height: 34px !important; padding: 0 7px !important; font-size: .56rem !important; }
.attack-bottom-actions .manual-team-error-button { grid-column: 2; }

/* Eine einzige, einzeilige und horizontal scrollbar Aktionshistorie. */
.scouting-raw-row.recent-actions-row {
    min-height: 49px !important;
    max-height: 49px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    margin-top: 0 !important;
}
.recent-actions-card {
    min-height: 0 !important;
    height: 49px !important;
    padding: 4px 6px !important;
    display: grid !important;
    grid-template-rows: 17px 25px !important;
    gap: 2px !important;
    overflow: hidden !important;
}
.recent-actions-card .raw-head { line-height: 1; }
.recent-action-strip {
    min-width: 0;
    width: 100%;
    height: 25px;
    display: flex;
    align-items: stretch;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
}
.recent-action-item {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 245px;
    height: 25px;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: end;
    font-size: .56rem;
    font-weight: 850;
}
.recent-action-item.reception {
    background: #f2e9fb;
    border-color: #c9a7e8;
    color: #5e2785;
}
.recent-action-item.attack {
    background: #e8f5fc;
    border-color: #9fd3ef;
    color: #165f86;
}
.recent-action-type { font-weight: 1000; }
.recent-action-player {
    min-width: 0;
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-action-quality {
    flex: 0 0 auto;
    min-width: 23px;
    height: 19px;
    padding: 0 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.74);
    font-weight: 1000;
}
.recent-action-empty { color: var(--muted); font-size: .58rem; padding: 5px 2px; }

/* Aktions-Overlay: Spielerin, Qualität und Richtung können in einer Karte geändert werden. */
.action-edit-card { width: min(620px, calc(100vw - 28px)) !important; max-height: calc(100vh - 28px); overflow: hidden; }
.action-edit-body {
    min-height: 0;
    max-height: calc(100vh - 145px);
    overflow-y: auto;
    display: grid !important;
    gap: 8px !important;
    padding: 4px 1px 10px !important;
}
.action-edit-body > div { display: block !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
.action-edit-summary {
    border-radius: 9px !important;
    padding: 8px 10px !important;
    font-size: .72rem;
    font-weight: 900;
}
.action-edit-summary.reception { background: #f2e9fb !important; color: #5e2785; border: 1px solid #c9a7e8 !important; }
.action-edit-summary.attack { background: #e8f5fc !important; color: #165f86; border: 1px solid #9fd3ef !important; }
.action-edit-grid { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px !important; }
.action-edit-field {
    display: grid !important;
    gap: 4px !important;
    padding: 7px 8px !important;
    border: 1px solid var(--border) !important;
    border-radius: 9px !important;
    background: #f8faf8 !important;
}
.action-edit-field > label,
.action-edit-label { color: var(--muted); font-size: .61rem; font-weight: 900; }
.action-edit-field select { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 7px; background: #fff; padding: 0 7px; font-size: .7rem; font-weight: 800; }
.action-quality-buttons,
.action-phase-buttons,
.action-out-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.action-quality-buttons button,
.action-phase-buttons button,
.action-out-buttons button {
    min-width: 38px;
    height: 31px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    font-weight: 950;
}
.action-quality-buttons button.active,
.action-phase-buttons button.active,
.action-out-buttons button.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.action-coordinate-section { display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px !important; }
.action-coordinate-block { display: grid !important; gap: 5px !important; }
.action-coordinate-pad {
    position: relative;
    width: 100%;
    aspect-ratio: 1.55 / 1;
    border: 2px solid #198f42;
    border-radius: 7px;
    background:
        linear-gradient(to right, transparent calc(33.333% - 1px), rgba(25,143,66,.38) 33.333%, transparent calc(33.333% + 1px)),
        linear-gradient(to right, transparent calc(66.666% - 1px), rgba(25,143,66,.38) 66.666%, transparent calc(66.666% + 1px)),
        linear-gradient(to bottom, transparent calc(50% - 1px), rgba(25,143,66,.38) 50%, transparent calc(50% + 1px)),
        #f7fbf8;
    cursor: crosshair;
    overflow: hidden;
}
.action-coordinate-pad.disabled { opacity: .38; cursor: default; }
.action-coordinate-marker {
    position: absolute;
    width: 13px;
    height: 13px;
    margin: -6.5px 0 0 -6.5px;
    border-radius: 50%;
    background: #17211b;
    box-shadow: 0 0 0 3px rgba(255,255,255,.86);
    pointer-events: none;
}
.action-error-toggle { display: flex !important; align-items: center; gap: 7px; min-height: 31px; font-size: .68rem; font-weight: 850; }
.action-error-toggle input { width: 18px; height: 18px; }
.action-edit-readonly { padding: 7px 9px !important; border-radius: 8px !important; background: #eef2ef !important; color: var(--muted); font-size: .65rem; font-weight: 800; }
.action-modal-actions { display: flex !important; justify-content: space-between !important; gap: 8px !important; }
.action-modal-actions .primary-action { margin-left: auto; }

@media (max-width: 900px) {
    .games-page { grid-template-rows: 38px 42px 54px auto minmax(95px, 1fr) !important; }
    .game-team-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .game-fields { height: auto !important; grid-template-columns: 1fr 120px !important; grid-auto-rows: 37px; }
    .game-fields .game-notes { grid-column: 1; }
    .game-fields .primary-action { grid-column: 2; }
    .game-history-list { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
    .action-edit-grid,
    .action-coordinate-section { grid-template-columns: 1fr !important; }
}

/* --------------------------------------------------------------------------
   0.15.0 – Vollbildnavigation, responsive Startaufstellung, Auswertung,
   Ansichtslink und konfigurierbares Grund-Farbschema
   -------------------------------------------------------------------------- */

/* Im nativen Vollbild liegt links oben ein systemseitiger Schließen-Button.
   Deshalb wird das eigentliche Menü unabhängig von diesem Bereich exakt mittig
   positioniert; Marke und Versionsstempel verschwinden im nativen Vollbild. */
html.native-fullscreen-safe .top-nav {
    padding-left: 8px !important;
    padding-right: 8px !important;
    grid-template-columns: 1fr max-content 1fr !important;
}
html.native-fullscreen-safe .brand,
html.native-fullscreen-safe .version-stamp { visibility: hidden !important; }
html.native-fullscreen-safe .nav-buttons {
    grid-column: 2 !important;
    justify-self: center !important;
    justify-content: center !important;
    width: max-content !important;
    max-width: min(72vw, 820px) !important;
}
html.native-fullscreen-safe .top-actions {
    grid-column: 3 !important;
    justify-self: end !important;
}

/* Annahmezonen wieder klar erkennbar, aber weiterhin unter Spielerinnen und
   Rally-Pfeilen. Die Spielerinnen bleiben mit z-index 24 deutlich darüber. */
.court-zone-overlay { opacity: .72 !important; z-index: 2 !important; }
.court-zone-overlay .free-zone-shape { opacity: .90 !important; }
.free-zone-q3 { fill: rgba(74,193,94,.26) !important; stroke: rgba(26,139,48,.64) !important; }
.free-zone-q2 { fill: rgba(255,220,50,.29) !important; stroke: rgba(189,153,0,.67) !important; }
.court-zone-overlay pattern rect { opacity: .68 !important; }
.court-zone-overlay pattern line { opacity: .15 !important; }
.formation-player-token,
.continuous-court .player-token { z-index: 24 !important; }

/* Startaufstellungen: Die rechte Spielerliste wird responsiv schmaler. Die bis
   zu vier Neben-Sätze teilen sich immer die tatsächlich verfügbare Breite und
   können deshalb nicht mehr rechts aus dem iPad-Viewport herauslaufen. */
.lineup-workspace {
    grid-template-columns: minmax(0, 1fr) clamp(210px, 19vw, 292px) !important;
    gap: clamp(5px, .65vw, 9px) !important;
}
.lineup-set-row { grid-template-columns: 48px minmax(0,1fr) !important; gap: 4px !important; }
.lineup-stage-played .lineup-stage-cards,
.lineup-stage-future .lineup-stage-cards {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    grid-template-columns: none !important;
    gap: clamp(4px, .55vw, 8px) !important;
    overflow: hidden !important;
}
.lineup-stage-played .lineup-set-card,
.lineup-stage-future .lineup-set-card,
.lineup-layout-two-rows .lineup-stage-played .lineup-set-card,
.lineup-layout-two-rows .lineup-stage-future .lineup-set-card,
.lineup-layout-three-rows .lineup-stage-played .lineup-set-card,
.lineup-layout-three-rows .lineup-stage-future .lineup-set-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
}
.lineup-stage-played .mini-rotation,
.lineup-stage-future .mini-rotation {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    aspect-ratio: 3 / 2 !important;
}
.lineup-stage-current .lineup-stage-cards { display: flex !important; min-width: 0 !important; }
.lineup-stage-current .lineup-set-card {
    width: clamp(270px, 46%, 410px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
}
.lineup-roster-panel { min-width: 0 !important; width: 100% !important; }
.lineup-player-button { grid-template-columns: 39px minmax(0,1fr) 30px !important; gap: 4px !important; }
.lineup-player-button .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
    .lineup-workspace { grid-template-columns: minmax(0,1fr) clamp(190px, 19vw, 232px) !important; }
    .lineup-set-row { grid-template-columns: 42px minmax(0,1fr) !important; }
    .lineup-stage-current .lineup-set-card { width: clamp(245px, 48%, 350px) !important; min-width: 0 !important; }
    .lineup-player-button { grid-template-columns: 34px minmax(0,1fr) 27px !important; padding-inline: 4px !important; }
    .lineup-player-button .name { font-size: .65rem !important; }
    .lineup-player-button .num { font-size: .9rem !important; }
    .lineup-toolbar-actions { gap: 3px !important; }
    .lineup-toolbar-actions .small-action { padding-inline: 7px !important; font-size: .58rem !important; }
}

@media (max-width: 980px) {
    .lineup-workspace { grid-template-columns: minmax(0,1fr) 184px !important; }
    .lineup-set-row { grid-template-columns: 36px minmax(0,1fr) !important; }
    .lineup-stage-label { font-size: .52rem !important; }
    .lineup-stage-current .lineup-set-card { width: min(330px, 52%) !important; }
}

/* Auswertung erhält eine zweite Navigationsebene: Angriff / Annahme. */
.evaluation-page {
    grid-template-rows: 48px 38px minmax(0,1fr) !important;
    gap: 7px !important;
}
.evaluation-subnav {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}
.evaluation-subnav button {
    height: 28px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: .67rem;
    font-weight: 950;
}
.evaluation-subnav button.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.evaluation-panel { min-height: 0; height: 100%; overflow: hidden; }
.evaluation-panel .evaluation-grid { height: 100%; }
#evaluationReceptionPanel { overflow-y: auto; }
.reception-evaluation-head {
    min-height: 38px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 9px;
    color: var(--ink);
}
.reception-evaluation-head strong { font-size: .82rem; }
.reception-evaluation-head span { color: var(--muted); font-size: .62rem; font-weight: 750; }
.reception-evaluation-list {
    min-height: 0;
    display: grid;
    gap: 6px;
    padding: 0 8px 10px;
}
.reception-evaluation-row {
    min-height: 58px;
    display: grid;
    grid-template-columns: 34px 58px minmax(0,1fr) 92px;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--reception-eval-color);
    border-left: 7px solid var(--reception-eval-color);
    border-radius: 10px;
    background: var(--reception-eval-soft);
}
.reception-eval-rank {
    width: 27px; height: 27px; display: grid; place-items: center;
    border-radius: 999px; background: rgba(255,255,255,.75);
    color: var(--muted); font-size: .68rem; font-weight: 950;
}
.reception-eval-number { font-size: 1.55rem; line-height: 1; font-weight: 1000; color: var(--reception-eval-color); text-align: center; }
.reception-eval-name { min-width: 0; display: grid; gap: 2px; }
.reception-eval-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.reception-eval-name small { color: var(--muted); font-size: .61rem; font-weight: 750; }
.reception-eval-percent { justify-self: end; font-size: 1rem; font-weight: 1000; color: var(--reception-eval-color); }

/* Spiele: zusätzlicher Button für den dauerhaften Ansichtslink. */
.active-game-card {
    grid-template-columns: minmax(0,1fr) auto auto auto auto !important;
}
.viewer-link-button { white-space: nowrap; color: var(--primary-dark) !important; border-color: var(--primary) !important; background: var(--primary-soft) !important; }

/* Farbschema als eigener Einstellungs-Unterpunkt. */
.theme-settings-page {
    height: 100%; min-height: 0;
    display: grid;
    grid-template-rows: 38px 44px minmax(0,1fr);
    gap: 8px;
}
.theme-settings-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(250px,.75fr) minmax(420px,1.35fr);
    gap: 10px;
    align-content: start;
}
.theme-presets-card,
.theme-custom-card { min-height: 0; display: grid; align-content: start; gap: 10px; }
.theme-preset-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.theme-preset-buttons button {
    min-height: 46px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr);
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
}
.theme-preset-buttons button > span {
    width: 38px; height: 30px; border-radius: 7px;
    background: linear-gradient(90deg,var(--preset-primary) 0 68%,var(--preset-accent) 68% 100%);
    border: 1px solid rgba(0,0,0,.13);
}
.theme-preset-buttons button b { font-size: .7rem; }
.theme-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.theme-field-grid > label { display: grid; gap: 4px; color: var(--muted); font-size: .63rem; font-weight: 900; }
.theme-field-grid > label > div { min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 5px; }
.theme-field-grid input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.theme-field-grid input:not([type="color"]) { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: .7rem; font-weight: 800; }
.theme-field-grid input.invalid { border-color: #D64545; background: #FFF2F1; }
.theme-save-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.theme-save-row > span { color: var(--muted); font-size: .62rem; font-weight: 750; }

@media (max-width: 1050px) {
    .theme-settings-grid { grid-template-columns: 1fr 1.35fr; }
    .theme-field-grid { grid-template-columns: 1fr; }
}

/* Dynamische Grundfarben auch für bislang fest grün codierte UI-Elemente. */
.settings-subnav { background: var(--primary-soft) !important; border-color: var(--border) !important; }
.settings-subnav button { color: var(--primary-dark) !important; border-color: var(--border) !important; background: var(--surface) !important; }
.settings-subnav button.active { background: var(--primary-dark) !important; color: #fff !important; border-color: var(--primary-dark) !important; }
.evaluation-phase-filter button.active { background: var(--primary-soft) !important; border-color: var(--primary) !important; color: var(--primary-dark) !important; box-shadow: inset 0 0 0 1px var(--primary) !important; }
.realtime-status { background: var(--primary-soft) !important; color: var(--primary-dark) !important; }

/* Externer Spiel-Link: nur Scouting und Auswertung, ohne Eingabewerkzeuge. */
.external-viewer #view-scouting .court-bottom-actions { display: none !important; }
.external-viewer #view-scouting .combined-volleyball-court .court-slot { grid-template-rows: 0 auto 0 !important; }
.external-viewer #view-scouting .quality-override,
.external-viewer #view-scouting .no-k1-button,
.external-viewer #view-scouting .reception-error-button,
.external-viewer #view-scouting .manual-team-error-button { display: none !important; }
.external-viewer #view-scouting .score-controls button { display: none !important; }
.external-viewer #view-scouting .score-controls { justify-content: center !important; }
.external-viewer #view-scouting .formation-player-token,
.external-viewer #view-scouting .continuous-court,
.external-viewer #view-scouting .attack-out-strip,
.external-viewer #view-scouting .scouting-toolbar .toolbar-actions { pointer-events: none !important; }
.external-viewer #view-scouting .scouting-toolbar .toolbar-actions { opacity: .78 !important; }

/* Spielerinnen ohne bewertete Annahme bleiben in der Liste sichtbar, werden
   aber neutral hinter den tatsächlich gerankten Spielerinnen einsortiert. */
.reception-evaluation-row.unrated { opacity: .72; }
.reception-evaluation-row.unrated .reception-eval-number,
.reception-evaluation-row.unrated .reception-eval-percent { color: var(--muted); }

/* Weitere grundlayoutbezogene Grünflächen folgen dem gewählten Theme.
   Qualitäts-/Ampelfarben und die farbliche Angriffsklassifikation bleiben fest. */
.runner-position-badge { border-color: var(--primary-dark) !important; color: var(--primary-dark) !important; }
.variant-formation-mode button.active { border-color: var(--primary) !important; color: var(--primary-dark) !important; }
.team-button.game-team::after { color: var(--primary-dark) !important; }
.eval-court-bg { stroke: var(--court-line) !important; }
.eval-three-meter { stroke: var(--primary) !important; }
.eval-net { stroke: var(--primary-dark) !important; }
.action-coordinate-pad { border-color: var(--court-line) !important; }

/* Exakte Vollbild-Zentrierung unabhängig von den rechten Status-/Vollbildbuttons. */
html.native-fullscreen-safe .brand,
html.native-fullscreen-safe .version-stamp { display: none !important; }
html.native-fullscreen-safe .nav-buttons {
    position: absolute !important;
    left: 50% !important;
    top: calc(env(safe-area-inset-top) + (var(--nav-h) / 2)) !important;
    transform: translate(-50%, -50%) !important;
    max-width: min(64vw, 820px) !important;
}

/* --------------------------------------------------------------------------
   0.15.1 – Layout-Stabilisierung: Scouting-Fußbereich, Annahmeauswertung,
   Annahmeaufstellungen
   -------------------------------------------------------------------------- */

/* Scouting: der Court muss seine echte, aus der Breite abgeleitete Höhe in das
   Grid einbringen. Damit stehen Fehlerzeile und "Letzte Aktionen" garantiert
   unterhalb des Spielfelds und können nicht mehr mitten durch den Court laufen. */
.scouting-main {
    grid-template-rows: 42px auto 49px !important;
    align-content: start !important;
    overflow: visible !important;
}
.combined-volleyball-court {
    grid-row: 2 !important;
    padding-bottom: 0 !important;
}
.combined-volleyball-court .court-slot {
    grid-template-rows: 0 auto 76px !important;
    align-content: start !important;
    overflow: visible !important;
}
.combined-volleyball-court .reception-court-frame,
.combined-volleyball-court .attack-target-wrapper {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    align-self: start !important;
}
.combined-volleyball-court .attack-target-wrapper > .attack-court-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
}
.court-bottom-actions {
    position: relative !important;
    z-index: 32 !important;
    align-self: start !important;
    margin-top: 34px !important;
    height: 38px !important;
    min-height: 38px !important;
    overflow: visible !important;
}
.reception-error-button,
.manual-team-error-button,
.no-k1-button,
.quality-override {
    visibility: visible;
}
.scouting-raw-row.recent-actions-row {
    grid-row: 3 !important;
    position: relative !important;
    inset: auto !important;
    z-index: 35 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 49px !important;
    max-height: 49px !important;
    margin: 0 !important;
    align-self: start !important;
}
.recent-actions-card {
    width: 100% !important;
    max-width: 100% !important;
}

/* Annahmeauswertung: maximal 14 Spielkader-Spielerinnen passen ohne Scrollen.
   Die Zeilenhöhe richtet sich am Viewport aus und bleibt bei kleinen Kadern
   kompakt, statt die gesamte freie Höhe aufzublasen. */
#evaluationReceptionPanel {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-rows: 30px minmax(0, 1fr) !important;
    align-content: start !important;
}
#evaluationReceptionPanel[hidden] { display: none !important; }
.reception-evaluation-head {
    min-height: 0 !important;
    height: 30px !important;
    padding: 3px 8px !important;
    gap: 8px !important;
    align-items: center !important;
}
.reception-evaluation-head strong { font-size: .76rem !important; }
.reception-evaluation-head span { font-size: .56rem !important; }
.reception-evaluation-list {
    min-height: 0 !important;
    height: auto !important;
    max-height: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: clamp(28px, calc((100dvh - 220px) / 14), 44px) !important;
    align-content: start !important;
    gap: 3px !important;
    padding: 0 7px 4px !important;
    overflow: hidden !important;
}
.reception-evaluation-row {
    min-height: 0 !important;
    height: 100% !important;
    grid-template-columns: 48px minmax(0, 1fr) 76px !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 2px 8px !important;
    border-left-width: 6px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}
.reception-eval-rank { display: none !important; }
.reception-eval-number {
    font-size: clamp(1rem, 1.45vw, 1.28rem) !important;
    line-height: 1 !important;
}
.reception-eval-name {
    gap: 0 !important;
    align-content: center !important;
}
.reception-eval-name strong {
    font-size: clamp(.66rem, .88vw, .78rem) !important;
    line-height: 1.08 !important;
}
.reception-eval-name small {
    font-size: clamp(.48rem, .65vw, .57rem) !important;
    line-height: 1.08 !important;
}
.reception-eval-percent {
    font-size: clamp(.72rem, 1vw, .88rem) !important;
}

/* Einstellungen → Annahmeaufstellungen: Seit dem Untermenü bestehen drei
   echte Zeilen. Die dritte Zeile bekommt wieder den kompletten Editor, statt
   als implizite Grid-Zeile an den unteren Bildschirmrand gedrückt zu werden. */
#view-formations .settings-page {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 38px 42px minmax(0, 1fr) !important;
    gap: 8px !important;
    overflow: hidden !important;
}
#view-formations .settings-page > .settings-subnav { grid-row: 1 !important; }
#view-formations .settings-page > .settings-toolbar { grid-row: 2 !important; }
#view-formations .reception-variant-settings {
    grid-row: 3 !important;
    min-height: 0 !important;
    height: 100% !important;
    align-self: stretch !important;
    overflow: hidden !important;
}
#view-formations .variant-sidebar,
#view-formations .variant-editor {
    min-height: 0 !important;
    height: 100% !important;
}
#view-formations .variant-editor {
    grid-template-rows: 42px minmax(0, 1fr) !important;
}
#view-formations .reception-variant-courts {
    min-height: 0 !important;
    height: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    overflow: hidden !important;
}
#view-formations .variant-template-card {
    min-height: 0 !important;
    height: 100% !important;
    grid-template-rows: 22px minmax(0, 1fr) !important;
    align-items: start !important;
    overflow: hidden !important;
}
#view-formations .variant-template-court {
    width: min(100%, calc((100dvh - 220px) / 2)) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    align-self: center !important;
    justify-self: center !important;
}

@media (max-height: 760px) {
    .reception-evaluation-list {
        grid-auto-rows: clamp(26px, calc((100dvh - 205px) / 14), 38px) !important;
        gap: 2px !important;
    }
    .reception-evaluation-head { height: 27px !important; }
    #evaluationReceptionPanel { grid-template-rows: 27px minmax(0,1fr) !important; }
    #view-formations .variant-template-title { font-size: .62rem !important; }
}

/* Die Breite der beiden Court-Hälften wird in 0.15.1 zusätzlich per
   ResizeObserver als Pixelwert gesetzt. Dadurch kann das CSS die Grid-Höhe
   ohne zyklische Prozent-/Aspect-Ratio-Berechnung exakt reservieren. */
.combined-volleyball-court .court-slot {
    grid-template-rows: 0 var(--scouting-court-runtime, auto) 76px !important;
}
.combined-volleyball-court .reception-court-slot .continuous-court-frame,
.combined-volleyball-court .attack-target-wrapper {
    height: var(--scouting-court-runtime, auto) !important;
}

/* In der aktuellen DOM-Struktur gibt es keine eigene Titelzeile mehr im
   court-slot: Frame und Bedienzeile sind die beiden tatsächlichen Grid-Kinder. */
.combined-volleyball-court .court-slot {
    grid-template-rows: var(--scouting-court-runtime, auto) 76px !important;
}

/* Alte 9-Spalten-Regeln aus früheren Scouting-Versionen dürfen die neue
   dreispaltige Bedienzeile nicht mehr in implizite Grid-Spalten verschieben. */
.reception-bottom-actions > .reception-error-button {
    grid-column: 1 !important;
    grid-row: 1 !important;
}
.reception-bottom-actions > .court-action-center {
    grid-column: 2 !important;
    grid-row: 1 !important;
}
.reception-bottom-actions > .manual-team-error-button {
    grid-column: 3 !important;
    grid-row: 1 !important;
}
.attack-bottom-actions > .court-action-center {
    grid-column: 1 !important;
    grid-row: 1 !important;
}
.attack-bottom-actions > .manual-team-error-button {
    grid-column: 2 !important;
    grid-row: 1 !important;
}


/* --------------------------------------------------------------------------
   0.15.2 – Reparaturen: Zonen, kompakte letzte Aktionen, Fehlerbeschriftung
   -------------------------------------------------------------------------- */
#view-zones .zones-page {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 38px minmax(0, 1fr) !important;
    gap: 8px !important;
    overflow: hidden !important;
}
#view-zones .zones-page > .settings-subnav {
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
}
#view-zones .zones-layout.free-zones-layout {
    grid-row: 2 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 8px !important;
    overflow: hidden !important;
}
#view-zones .zone-editor-column {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 42px auto minmax(0, 1fr) !important;
    gap: 7px !important;
    justify-items: stretch !important;
    align-items: stretch !important;
    overflow: hidden !important;
}
#view-zones .zones-toolbar { width: 100% !important; min-width: 0 !important; }
#view-zones .zone-editor-tools {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-content: center !important;
    overflow: visible !important;
}
#view-zones .zone-editor-shell {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    place-items: start center !important;
    overflow: hidden !important;
    padding: 3px !important;
}
#view-zones .zone-editor-court {
    width: min(100%, calc(100dvh - 235px), 760px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
}
#view-zones .zone-side {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: auto !important;
}

/* Nur die Aktions-Chips, ohne Überschrift oder Zusatztext. */
.scouting-main { grid-template-rows: 42px auto 35px !important; }
.scouting-raw-row.recent-actions-row {
    min-height: 35px !important;
    max-height: 35px !important;
    height: 35px !important;
}
.recent-actions-card {
    height: 35px !important;
    min-height: 35px !important;
    padding: 4px 6px !important;
    grid-template-rows: 27px !important;
    gap: 0 !important;
}
.recent-actions-card .raw-head { display: none !important; }
.recent-action-strip { height: 27px !important; }
.recent-action-item {
    min-width: 112px !important;
    max-width: 180px !important;
    height: 27px !important;
    padding: 2px 6px !important;
    gap: 5px !important;
}
.recent-action-player { max-width: 42px !important; }

/* Fehlerbuttons tragen den vollständigen Mannschaftsnamen in einer Zeile. */
.manual-team-error-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: clamp(.54rem, .72vw, .67rem) !important;
    font-weight: 950 !important;
    padding: 0 6px !important;
}

/* Angriffs-Aufstellungsmarker bleiben beim Ziehen unter dem Finger und werden
   nicht durch Browser-Panning oder Textselektion zurückgesetzt. */
#view-formations .variant-position-marker {
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

@media (max-width: 980px) {
    #view-zones .zones-layout.free-zones-layout {
        grid-template-columns: minmax(0, 1fr) 210px !important;
    }
    #view-zones .zone-editor-court {
        width: min(100%, calc(100dvh - 255px), 680px) !important;
    }
}

/* --------------------------------------------------------------------------
   0.15.3 – Vollbildnavigation, Scouting-Bedienleiste und Zoneneditor
   -------------------------------------------------------------------------- */

/* Vollbild: Das Hauptmenü wird relativ zum VIEWPORT zentriert, nicht relativ
   zu den links/rechts unterschiedlich breiten Kopfbereichen. Damit bleibt es
   auch neben dem systemseitigen Vollbild-Schließen-Button mittig. */
html.native-fullscreen-safe .brand,
html.native-fullscreen-safe .version-stamp,
html.app-focus-mode .brand,
html.app-focus-mode .version-stamp,
html:fullscreen .brand,
html:fullscreen .version-stamp,
html:-webkit-full-screen .brand,
html:-webkit-full-screen .version-stamp {
    display: none !important;
}
html.native-fullscreen-safe .nav-buttons,
html.app-focus-mode .nav-buttons,
html:fullscreen .nav-buttons,
html:-webkit-full-screen .nav-buttons {
    position: fixed !important;
    left: 50vw !important;
    top: calc(env(safe-area-inset-top) + (var(--nav-h) / 2)) !important;
    transform: translate(-50%, -50%) !important;
    width: max-content !important;
    max-width: calc(100vw - 230px) !important;
    justify-content: center !important;
    justify-self: auto !important;
    z-index: 10020 !important;
    overflow: visible !important;
}
html.native-fullscreen-safe .top-actions,
html.app-focus-mode .top-actions,
html:fullscreen .top-actions,
html:-webkit-full-screen .top-actions {
    position: absolute !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    top: env(safe-area-inset-top) !important;
    height: var(--nav-h) !important;
    z-index: 10030 !important;
}
@media (max-width: 1050px) {
    html.native-fullscreen-safe .nav-button,
    html.app-focus-mode .nav-button,
    html:fullscreen .nav-button,
    html:-webkit-full-screen .nav-button {
        padding-inline: 8px !important;
        font-size: .66rem !important;
    }
}

/* Letzte Aktionen: nur Kurztyp, Trikotnummer und Qualität. */
.recent-action-item {
    min-width: 82px !important;
    max-width: 128px !important;
    justify-content: flex-start !important;
}
.recent-action-type { flex: 0 0 auto !important; }
.recent-action-player { flex: 0 0 auto !important; max-width: none !important; }
.recent-action-quality { margin-left: auto !important; }

/* Seitliche Aufschlag-Schalter. Sie liegen außerhalb des gesamten Feldes und
   bleiben unabhängig von den roten AUS-Flächen anklickbar. */
.combined-volleyball-court { overflow: visible !important; }
.serve-side-button {
    position: absolute !important;
    top: 50% !important;
    width: 34px !important;
    height: 112px !important;
    transform: translateY(-50%) !important;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid var(--primary) !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: var(--primary-dark) !important;
    font-size: .66rem !important;
    font-weight: 950 !important;
    letter-spacing: .02em;
    z-index: 55 !important;
    box-shadow: 0 2px 8px rgba(16,24,40,.10);
}
.serve-side-button:hover,
.serve-side-button:active { background: var(--primary-soft) !important; }
.serve-side-button.active {
    background: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.serve-side-button:disabled { opacity: .40 !important; cursor: default; }
.serve-side-left { left: -42px !important; transform: translateY(-50%) rotate(180deg) !important; }
.serve-side-right { right: -42px !important; }
.view-only-mode .serve-side-button,
.external-viewer .serve-side-button { display: none !important; }

/* Bedienung unter dem Court entspricht geometrisch den drei 3-m-breiten
   Teilbereichen jeder Feldhälfte. Teamfehler sitzen jeweils unter dem inneren
   3-m-Raum; Annahmefehler bleibt links außen. */
.combined-volleyball-court .court-slot {
    grid-template-rows: var(--scouting-court-runtime, auto) 76px !important;
}
.court-bottom-actions {
    margin-top: 0 !important;
    height: 76px !important;
    min-height: 76px !important;
    padding: 4px 0 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 31px 35px !important;
    gap: 4px 0 !important;
    align-items: stretch !important;
    overflow: visible !important;
}
.reception-bottom-actions > .reception-error-button {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 35px !important;
    margin: 0 !important;
}
.reception-bottom-actions > .reception-action-center {
    grid-column: 2 !important;
    grid-row: 2 !important;
    height: 35px !important;
    padding-inline: 4px;
}
.reception-front-zone-controls {
    grid-column: 3 !important;
    grid-row: 1 / 3 !important;
    min-width: 0;
    display: grid;
    grid-template-rows: 31px 35px;
    gap: 4px;
    align-items: stretch;
}
.reception-front-zone-controls > .manual-team-error-button {
    width: 100% !important;
    height: 35px !important;
    margin: 0 !important;
}
.reception-quick-quality {
    width: 100%;
    height: 31px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
}
.reception-quick-quality[hidden] { display: none !important; }
.reception-quick-quality button {
    min-width: 0 !important;
    width: 100% !important;
    height: 31px !important;
    padding: 0 !important;
    border: 1px solid rgba(16,24,40,.18) !important;
    border-radius: 7px !important;
    font-size: .72rem !important;
    font-weight: 950 !important;
    color: #172018 !important;
}
.reception-quick-quality .q0 { background: #f6c8c4 !important; border-color: #e34d42 !important; }
.reception-quick-quality .q1 { background: #f3f5f3 !important; }
.reception-quick-quality .q2 { background: #ffe23e !important; }
.reception-quick-quality .q3 { background: #58c96a !important; }

.attack-bottom-actions > .attack-front-zone-controls {
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-width: 0;
    height: 35px;
}
.attack-front-zone-controls > .manual-team-error-button {
    width: 100% !important;
    height: 35px !important;
    margin: 0 !important;
}
.attack-bottom-actions > .attack-action-center {
    grid-column: 2 / 4 !important;
    grid-row: 1 / 3 !important;
    height: 70px !important;
    justify-content: center !important;
    padding-inline: 4px;
}
.manual-team-error-button {
    border-radius: 7px !important;
    padding-inline: 4px !important;
}

/* Der Zoneneditor erhält eine echte, quadratische Pixelgröße per JS. CSS
   liefert das vollständig sichtbare Spielfeld samt Raster und 3-m-Linie. */
#view-zones .zones-page {
    grid-template-rows: 38px minmax(0, 1fr) !important;
}
#view-zones .zones-layout.free-zones-layout {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px) !important;
}
#view-zones .zone-editor-column {
    min-width: 0 !important;
    min-height: 0 !important;
    grid-template-rows: 42px auto minmax(0, 1fr) !important;
}
#view-zones .zone-editor-shell {
    min-width: 0 !important;
    min-height: 280px !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 6px !important;
    overflow: hidden !important;
}
#view-zones .zone-editor-court {
    position: relative !important;
    flex: 0 0 auto !important;
    max-width: calc(100% - 4px) !important;
    max-height: calc(100% - 4px) !important;
    aspect-ratio: 1 / 1 !important;
    border: 3px solid var(--court-line) !important;
    background-color: #fff !important;
    background-image:
        linear-gradient(to right, rgba(52,64,84,.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(52,64,84,.10) 1px, transparent 1px) !important;
    background-size: calc(100% / 9) calc(100% / 9) !important;
    box-sizing: border-box !important;
    touch-action: none !important;
    overflow: visible !important;
}
#view-zones .zone-editor-svg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 4 !important;
}
#view-zones .zone-editor-netline {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: calc(100% * 6 / 9) !important;
    width: 4px !important;
    height: 100% !important;
    background: var(--primary) !important;
    z-index: 6 !important;
    pointer-events: none !important;
}
#view-zones .zone-side { overflow: hidden !important; }

@media (max-width: 980px) {
    #view-zones .zones-layout.free-zones-layout {
        grid-template-columns: minmax(0, 1fr) 205px !important;
    }
    .serve-side-button { width: 30px !important; height: 98px !important; font-size: .60rem !important; }
    .serve-side-left { left: -36px !important; }
    .serve-side-right { right: -36px !important; }
}


/* --------------------------------------------------------------------------
   0.15.4 – kompakte Aktionsleiste, bündige Fehlerbuttons, 80%-Zoneneditor,
   sechs Aufstellungsfälle und höhenadaptive Angriffsauswertung
   -------------------------------------------------------------------------- */

/* Alle drei Fehlerbuttons liegen in derselben unteren Bedienzeile. Wenn die
   Schnellqualität ausgeblendet ist, darf der Teamfehler nicht in Zeile 1
   hochrutschen. */
.reception-front-zone-controls > .manual-team-error-button {
    grid-row: 2 !important;
    align-self: stretch !important;
}
.reception-bottom-actions > .reception-error-button,
.reception-front-zone-controls > .manual-team-error-button,
.attack-front-zone-controls > .manual-team-error-button {
    height: 35px !important;
    min-height: 35px !important;
    align-self: end !important;
}

/* Letzte Aktionen: kleinerer horizontaler Abstand; Qualität nur als 0–3 und
   exakt in den bestehenden Qualitäts-/Ampelfarben. */
.recent-action-strip {
    gap: 2px !important;
}
.recent-action-item {
    min-width: 68px !important;
    max-width: 98px !important;
    height: 27px !important;
    padding: 2px 4px !important;
    gap: 3px !important;
}
.recent-action-quality {
    min-width: 20px !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    margin-left: 1px !important;
    border: 1px solid rgba(16,24,40,.13) !important;
    color: #172018 !important;
}
.recent-action-quality.q0 { background: var(--q0) !important; }
.recent-action-quality.q1 { background: var(--q1) !important; }
.recent-action-quality.q2 { background: var(--q2) !important; }
.recent-action-quality.q3 { background: var(--q3) !important; }
.recent-action-quality.qn { background: var(--qn) !important; }

/* Einstellungen → Zonen: keine rechte Bedien-/Legenden-Spalte mehr. Der
   Speichern-Block sitzt direkt in der Werkzeugleiste. */
#view-zones .zones-layout.free-zones-layout {
    grid-template-columns: minmax(0, 1fr) !important;
}
#view-zones .zone-side { display: none !important; }
#view-zones .zone-editor-tools {
    align-items: center !important;
    column-gap: 6px !important;
    row-gap: 5px !important;
}
#view-zones .zone-toolbar-save {
    margin-left: auto;
    display: flex !important;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
#view-zones .zone-toolbar-save .zone-count {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .56rem;
}
#view-zones .zone-toolbar-save .primary-action {
    width: auto !important;
    min-width: 148px;
    height: 31px;
    padding-inline: 10px;
    white-space: nowrap;
}
#view-zones .zone-editor-shell {
    align-items: flex-start !important;
    justify-content: center !important;
}
#view-zones .zone-editor-court {
    max-width: 80% !important;
    max-height: 80% !important;
}

/* Annahmeaufstellungen: beide Modi zeigen wieder alle sechs Läufer als echtes
   3×2-Raster. Die Courts beginnen direkt unter ihrer Überschrift und werden
   aus der verfügbaren Höhe für zwei vollständige Reihen berechnet. */
#view-formations .reception-variant-courts {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-content: stretch !important;
    align-items: stretch !important;
}
#view-formations .variant-template-card {
    min-height: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: 22px minmax(0, 1fr) !important;
    align-content: start !important;
    align-items: start !important;
    justify-items: center !important;
    overflow: hidden !important;
}
#view-formations .variant-template-court {
    width: min(100%, calc((100dvh - 255px) / 2)) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc((100dvh - 255px) / 2) !important;
    aspect-ratio: 1 / 1 !important;
    align-self: start !important;
    justify-self: center !important;
}
@media (max-height: 760px) {
    #view-formations .variant-template-court {
        width: min(100%, calc((100dvh - 235px) / 2)) !important;
        max-height: calc((100dvh - 235px) / 2) !important;
    }
}

/* Angriffsauswertung: jede sichtbare Grid-Zeile erhält höchstens die Hälfte
   der verfügbaren Panelhöhe. So sind immer zwei vollständige Felder untereinander
   sichtbar. Das Court-SVG wird innerhalb der Karte zusätzlich etwa 10 % kleiner. */
#evaluationAttackPanel .evaluation-grid {
    height: 100% !important;
    min-height: 0 !important;
    grid-auto-rows: calc((100% - 8px) / 2) !important;
    gap: 8px !important;
    align-content: start !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 2px !important;
}
#evaluationAttackPanel .evaluation-player-card {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    grid-template-rows: 50px minmax(0, 1fr) !important;
    gap: 3px !important;
    padding: 6px !important;
    overflow: hidden !important;
}
#evaluationAttackPanel .evaluation-court-svg {
    width: auto !important;
    height: 90% !important;
    max-width: 90% !important;
    max-height: 90% !important;
    aspect-ratio: auto !important;
    align-self: start !important;
    justify-self: center !important;
}

/* --------------------------------------------------------------------------
   0.15.5 – Qualitätsleiste, Rotationsreihenfolge und Spielhistorie
   -------------------------------------------------------------------------- */

/* Annahme- und Angriffsqualitäten liegen in derselben unteren Zeile wie die
   Fehlerbuttons. Keine Qualitätsgruppe darf mehr über dem Court schweben. */
.reception-bottom-actions > .reception-action-center,
.attack-bottom-actions > .attack-action-center {
    grid-row: 2 !important;
    height: 35px !important;
    min-height: 35px !important;
    align-self: end !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
}
.reception-bottom-actions > .reception-action-center { grid-column: 2 !important; }
.attack-bottom-actions > .attack-action-center { grid-column: 2 / 4 !important; }
.reception-front-zone-controls,
.attack-front-zone-controls {
    grid-row: 2 !important;
    height: 35px !important;
    min-height: 35px !important;
    align-self: end !important;
}
.reception-front-zone-controls {
    grid-column: 3 !important;
    display: block !important;
}
.attack-front-zone-controls { grid-column: 1 !important; }
.reception-front-zone-controls > .manual-team-error-button,
.attack-front-zone-controls > .manual-team-error-button,
.reception-bottom-actions > .reception-error-button {
    height: 35px !important;
    min-height: 35px !important;
    margin: 0 !important;
}
.reception-quick-quality,
.quality-override {
    height: 35px !important;
    min-height: 35px !important;
    align-items: center !important;
}
.reception-quick-quality {
    width: 100% !important;
    grid-template-columns: repeat(4, minmax(0,1fr)) !important;
}
.reception-quick-quality button,
.quality-override button,
.action-quality-buttons button {
    height: 31px !important;
    min-height: 31px !important;
    color: #172018 !important;
    border: 1px solid rgba(16,24,40,.17) !important;
    font-weight: 950 !important;
}

/* Einheitliches Qualitätsfarbsystem für sämtliche Qualitäts-BUTTONS. */
.reception-quick-quality button[data-reception-quick-quality="0"],
.quality-override button[data-quality="0"],
.action-quality-buttons button[data-action-quality="0"] { background: #ef5a50 !important; }
.reception-quick-quality button[data-reception-quick-quality="1"],
.quality-override button[data-quality="1"],
.action-quality-buttons button[data-action-quality="1"] { background: #f5a43b !important; }
.reception-quick-quality button[data-reception-quick-quality="2"],
.quality-override button[data-quality="2"],
.action-quality-buttons button[data-action-quality="2"] { background: #ffe23e !important; }
.reception-quick-quality button[data-reception-quick-quality="3"],
.quality-override button[data-quality="3"],
.action-quality-buttons button[data-action-quality="3"] { background: #58c96a !important; }

/* Die Qualitätszahlen in „Letzte Aktionen“ verwenden exakt dieselben Farben. */
.recent-action-quality.q0 { background: #ef5a50 !important; }
.recent-action-quality.q1 { background: #f5a43b !important; }
.recent-action-quality.q2 { background: #ffe23e !important; }
.recent-action-quality.q3 { background: #58c96a !important; }

/* Aufstellungseditor: immer zwei vollständige Zeilen innerhalb der verfügbaren
   Bildschirmhöhe. Der DOM liefert die Reihenfolge 1,6,5 / 2,3,4. */
#view-formations .variant-editor {
    grid-template-rows: 38px minmax(0,1fr) !important;
    gap: 5px !important;
}
#view-formations .variant-editor-head { min-height: 0 !important; }
#view-formations .reception-variant-courts {
    min-height: 0 !important;
    height: 100% !important;
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    grid-template-rows: repeat(2, minmax(0,1fr)) !important;
    gap: 6px !important;
    align-content: stretch !important;
    overflow: hidden !important;
}
#view-formations .variant-template-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    grid-template-rows: 19px minmax(0,1fr) !important;
    align-items: start !important;
    overflow: hidden !important;
}
#view-formations .variant-template-title {
    height: 19px !important;
    line-height: 18px !important;
    font-size: clamp(.54rem, .72vw, .66rem) !important;
}
#view-formations .variant-template-court {
    height: min(100%, calc((100dvh - 245px) / 2)) !important;
    width: auto !important;
    max-height: calc((100dvh - 245px) / 2) !important;
    max-width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    align-self: start !important;
    justify-self: center !important;
}
@media (max-height: 820px) {
    #view-formations .variant-template-court {
        height: min(100%, calc((100dvh - 225px) / 2)) !important;
        max-height: calc((100dvh - 225px) / 2) !important;
    }
    #view-formations .reception-variant-courts { gap: 4px !important; }
}

/* Letzte Spiele: kompakte Karten mit Satzständen und direkten Aktionen. */
.game-history-list {
    grid-auto-rows: 88px !important;
    grid-template-rows: none !important;
    align-content: start !important;
    overflow-y: auto !important;
}
.game-history-card-0155 {
    height: 88px !important;
    min-height: 88px !important;
    align-content: start !important;
    grid-template-rows: 17px 13px 16px 30px !important;
    gap: 2px !important;
    padding: 5px 6px !important;
}
.game-history-date-0155 { line-height: 13px; }
.game-history-scores-0155 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font-size: .54rem;
    font-weight: 850;
    line-height: 16px;
}
.game-history-actions-0155 {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 3px;
}
.game-history-actions-0155 .small-action {
    min-width: 0 !important;
    height: 28px !important;
    padding: 0 4px !important;
    font-size: .5rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.court-bottom-actions .quality-override span { display: none !important; }

/* --------------------------------------------------------------------------
   0.15.6 – Ansichts-Läuferwahl, Aktionsleiste und Satzabschluss
   -------------------------------------------------------------------------- */

/* Im reinen Ansichtsmodus wird die Historienzeile nicht benötigt. */
.view-only-mode #view-scouting .recent-actions-row,
.external-viewer #view-scouting .recent-actions-row {
    display: none !important;
}

/* Eingabemodus: etwas mehr vertikale Luft für den horizontalen Scrollbalken,
   gleichzeitig schmalere Karten ohne unnötigen Leerraum rechts der Qualität. */
.scouting-raw-row.recent-actions-row {
    min-height: 41px !important;
    max-height: 41px !important;
    height: 41px !important;
}
.recent-actions-card {
    min-height: 41px !important;
    height: 41px !important;
    padding: 3px 5px 2px !important;
    grid-template-rows: 35px !important;
}
.recent-action-strip {
    height: 35px !important;
    gap: 2px !important;
    padding: 1px 0 7px !important;
    align-items: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    scrollbar-gutter: stable !important;
}
.recent-action-item {
    min-width: 62px !important;
    max-width: 86px !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 1px 3px !important;
    gap: 2px !important;
    flex: 0 0 auto !important;
}
.recent-action-quality {
    width: 19px !important;
    min-width: 19px !important;
    height: 19px !important;
    margin-left: 0 !important;
    flex: 0 0 19px !important;
}

/* Läuferwahl in beiden schreibgeschützten Ansichtsarten. Die restlichen
   Scouting-Bedienelemente bleiben gesperrt, die Läuferwahl aber anklickbar. */
.viewer-runner-control {
    display: inline-grid;
    grid-template-columns: repeat(7, minmax(30px, auto));
    gap: 3px;
    align-items: center;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    white-space: nowrap;
}
.viewer-runner-control[hidden] { display: none !important; }
.viewer-runner-control button {
    height: 32px;
    min-width: 32px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: .67rem;
    font-weight: 950;
}
.viewer-runner-control button.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.viewer-runner-control button.live.active {
    background: var(--primary);
    color: #fff;
}
.view-only-mode #view-scouting .scouting-toolbar .toolbar-actions,
.external-viewer #view-scouting .scouting-toolbar .toolbar-actions {
    pointer-events: auto !important;
    opacity: 1 !important;
}
.view-only-mode #view-scouting .scouting-toolbar .toolbar-actions > :not(.viewer-runner-control),
.external-viewer #view-scouting .scouting-toolbar .toolbar-actions > :not(.viewer-runner-control) {
    pointer-events: none !important;
    opacity: .42 !important;
}
.view-only-mode #viewerRunnerControl,
.external-viewer #viewerRunnerControl {
    pointer-events: auto !important;
    opacity: 1 !important;
}

@media (max-width: 1050px) {
    .viewer-runner-control {
        grid-template-columns: repeat(7, 28px);
        gap: 2px;
    }
    .viewer-runner-control button {
        width: 28px;
        min-width: 28px;
        height: 29px;
        padding: 0;
        font-size: .61rem;
    }
    .view-only-mode #view-scouting .scouting-toolbar .toolbar-left .toolbar-note,
    .external-viewer #view-scouting .scouting-toolbar .toolbar-left .toolbar-note {
        display: none !important;
    }
}

/* Bestätigter Satz: visuell als festgeschrieben markieren. */
.score-card.set-finished {
    border-color: var(--primary) !important;
    box-shadow: inset 0 0 0 1px var(--primary-soft);
}
.score-card.set-finished .score-card-head::after {
    content: 'beendet';
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .54rem;
    font-weight: 950;
}

/* Satzende-Abfrage. */
.set-end-card {
    width: min(92vw, 470px) !important;
    display: grid;
    gap: 14px;
}
.set-end-body {
    display: grid;
    gap: 12px;
    text-align: center;
}
.set-end-body p {
    margin: 0;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.42;
}
.set-end-score {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--page);
}
.set-end-score span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .69rem;
    font-weight: 900;
    color: var(--primary-dark);
}
.set-end-score strong {
    font-size: 1.75rem;
    line-height: 1;
}
.set-end-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.set-end-actions button { min-height: 42px; }

/* --------------------------------------------------------------------------
   0.15.7 – Halbellipse am Netz, sofortiges Satzende und stabile Startaufstellung
   -------------------------------------------------------------------------- */

/* Startaufstellung: der obere Bereich enthält nur noch echte Bedienfunktionen.
   Die rechte Spielerinnen-Spalte behält ihre bisherige Breite; lediglich ihr
   Kopf darf nicht mehr mit einem Aktionsbutton kollidieren. */
#view-lineup .lineup-toolbar .toolbar-left {
    min-width: 0 !important;
    gap: 7px !important;
}
#view-lineup .lineup-toolbar-actions {
    min-width: 0 !important;
    gap: 4px !important;
}
#view-lineup .lineup-toolbar-actions .selection-info {
    min-width: 0 !important;
    max-width: clamp(150px, 22vw, 290px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
#view-lineup .lineup-roster-head {
    min-width: 0 !important;
    display: block !important;
    height: auto !important;
    min-height: 38px !important;
    padding: 1px 1px 3px !important;
}
#view-lineup .lineup-roster-head > div { min-width: 0 !important; }
#view-lineup .lineup-roster-head .side-title {
    line-height: 1.05 !important;
    white-space: nowrap !important;
}
#view-lineup .lineup-roster-head .side-hint {
    display: block !important;
    margin-top: 3px !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
#view-lineup .lineup-roster-panel {
    grid-template-rows: 40px minmax(0,1fr) !important;
}

/* Die bisherige responsive Breite der Spielerliste bleibt bestehen. Die
   Satzkarten werden dagegen wieder auf sinnvolle Maximalbreiten begrenzt.
   Dadurch kann ein einzelner bereits gespielter Satz nicht mehr die komplette
   linke Spalte und damit fast die gesamte Bildschirmhöhe belegen. */
#view-lineup .lineup-set-grid {
    min-height: 0 !important;
    align-content: start !important;
    gap: 6px !important;
    overflow: hidden !important;
}
#view-lineup .lineup-set-row {
    min-height: 0 !important;
    grid-template-columns: 42px minmax(0,1fr) !important;
    gap: 5px !important;
}
#view-lineup .lineup-stage-cards,
#view-lineup .lineup-stage-played .lineup-stage-cards,
#view-lineup .lineup-stage-future .lineup-stage-cards,
#view-lineup .lineup-stage-current .lineup-stage-cards {
    min-width: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    overflow: hidden !important;
}
#view-lineup .lineup-stage-played .lineup-set-card,
#view-lineup .lineup-stage-future .lineup-set-card,
#view-lineup .lineup-layout-two-rows .lineup-stage-played .lineup-set-card,
#view-lineup .lineup-layout-two-rows .lineup-stage-future .lineup-set-card,
#view-lineup .lineup-layout-three-rows .lineup-stage-played .lineup-set-card,
#view-lineup .lineup-layout-three-rows .lineup-stage-future .lineup-set-card {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 220px !important;
    height: auto !important;
    min-height: 0 !important;
    grid-template-rows: 27px auto 7px !important;
}
#view-lineup .lineup-stage-played .mini-rotation,
#view-lineup .lineup-stage-future .mini-rotation {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 3 / 2 !important;
}
#view-lineup .lineup-stage-current .lineup-set-card,
#view-lineup .lineup-stage-current .lineup-set-card.active-set {
    flex: 0 1 360px !important;
    width: min(360px, 100%) !important;
    min-width: 240px !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    grid-template-rows: 29px auto 7px !important;
}
#view-lineup .lineup-stage-current .mini-rotation,
#view-lineup .lineup-stage-current .active-set .mini-rotation {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 3 / 2 !important;
}
#view-lineup .lineup-set-card.active-set { overflow: hidden !important; }

/* Drei Satzgruppen (gespielt/aktuell/offen) müssen in der verfügbaren Höhe
   bleiben. Die Karten selbst bestimmen die Höhe; keine Gruppe erhält eine
   künstliche Resthöhe. */
#view-lineup .lineup-layout-three-rows {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 5px !important;
}

@media (max-width: 1180px) {
    #view-lineup .lineup-stage-played .lineup-set-card,
    #view-lineup .lineup-stage-future .lineup-set-card { max-width: 185px !important; }
    #view-lineup .lineup-stage-current .lineup-set-card,
    #view-lineup .lineup-stage-current .lineup-set-card.active-set {
        flex-basis: 315px !important;
        width: min(315px,100%) !important;
        min-width: 215px !important;
    }
    #view-lineup .lineup-toolbar-actions .selection-info { max-width: 180px !important; }
}

@media (max-height: 820px) {
    #view-lineup .lineup-stage-played .lineup-set-card,
    #view-lineup .lineup-stage-future .lineup-set-card { max-width: 165px !important; }
    #view-lineup .lineup-stage-current .lineup-set-card,
    #view-lineup .lineup-stage-current .lineup-set-card.active-set {
        flex-basis: 285px !important;
        width: min(285px,100%) !important;
        min-width: 200px !important;
    }
    #view-lineup .lineup-set-grid { gap: 4px !important; }
    #view-lineup .lineup-set-row { gap: 3px !important; }
    #view-lineup .lineup-player-button {
        height: 30px !important;
        min-height: 30px !important;
        flex-basis: 30px !important;
    }
}


/* --------------------------------------------------------------------------
   0.15.9 – Startaufstellung aufräumen
   -------------------------------------------------------------------------- */
/* Die rein beschreibenden Gruppenwörter links werden nicht mehr benötigt. */
#view-lineup .lineup-stage-label {
    display: none !important;
}
#view-lineup .lineup-set-row,
#view-lineup .lineup-set-row.lineup-stage-played,
#view-lineup .lineup-set-row.lineup-stage-current,
#view-lineup .lineup-set-row.lineup-stage-future {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
}

/* Der Kopf einer Satzkarte reserviert Platz für Titel, Rotation und Übernahme.
   Dadurch bleibt „← übernehmen“ auch am aktuellen Satz ab Satz 2 sichtbar. */
#view-lineup .lineup-set-head {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 4px !important;
    min-width: 0 !important;
}
#view-lineup .lineup-set-select {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
#view-lineup .copy-lineup-button,
#view-lineup .lineup-inline-rotate {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

/* Auswahl der Annahmeaufstellung gehört ins Scouting und erscheint hier nicht. */
#view-lineup .lineup-current-formation,
#view-lineup .lineup-formation-button {
    display: none !important;
}

/* --------------------------------------------------------------------------
   0.16.0 – Read-only Startaufstellung und Punktfolge im Ansichtsmodus
   -------------------------------------------------------------------------- */

/* Im Ansichtsmodus bleibt Startaufstellung erreichbar, ist aber rein lesend. */
.view-only-mode #view-lineup .lineup-toolbar-actions,
.external-viewer #view-lineup .lineup-toolbar-actions,
.view-only-mode #view-lineup .lineup-roster-panel,
.external-viewer #view-lineup .lineup-roster-panel {
    display: none !important;
}
.view-only-mode #view-lineup .lineup-team-button,
.external-viewer #view-lineup .lineup-team-button,
.view-only-mode #view-lineup #lineupTeamButton,
.external-viewer #view-lineup #lineupTeamButton {
    pointer-events: none !important;
}
.view-only-mode #view-lineup .lineup-workspace,
.external-viewer #view-lineup .lineup-workspace {
    grid-template-columns: minmax(0,1fr) !important;
    overflow: hidden !important;
}
.view-only-mode #view-lineup .lineup-set-grid.lineup-viewer-grid,
.external-viewer #view-lineup .lineup-set-grid.lineup-viewer-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, auto) !important;
    gap: 8px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    align-content: start !important;
    overflow: hidden !important;
}
.view-only-mode #view-lineup .lineup-viewer-grid .viewer-lineup-card,
.external-viewer #view-lineup .lineup-viewer-grid .viewer-lineup-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-rows: 28px auto 7px !important;
    padding: 5px !important;
    overflow: hidden !important;
}
.view-only-mode #view-lineup .lineup-viewer-grid .viewer-lineup-card .mini-rotation,
.external-viewer #view-lineup .lineup-viewer-grid .viewer-lineup-card .mini-rotation {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 3 / 2 !important;
}
.view-only-mode #view-lineup .lineup-viewer-grid .viewer-lineup-card .lineup-position-button,
.external-viewer #view-lineup .lineup-viewer-grid .viewer-lineup-card .lineup-position-button {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 3px !important;
    cursor: default !important;
}
.view-only-mode #view-lineup .lineup-viewer-grid .viewer-lineup-card .lineup-player-number,
.external-viewer #view-lineup .lineup-viewer-grid .viewer-lineup-card .lineup-player-number {
    font-size: clamp(1rem, 2.2vw, 1.7rem) !important;
}
.view-only-mode #view-lineup .lineup-viewer-grid .viewer-lineup-card .lineup-player-name,
.external-viewer #view-lineup .lineup-viewer-grid .viewer-lineup-card .lineup-player-name {
    font-size: clamp(.52rem, 1vw, .72rem) !important;
}
.view-only-mode #view-lineup .lineup-viewer-grid .viewer-lineup-card:nth-child(4),
.external-viewer #view-lineup .lineup-viewer-grid .viewer-lineup-card:nth-child(4) { grid-column: 1; grid-row: 2; }
.view-only-mode #view-lineup .lineup-viewer-grid .viewer-lineup-card:nth-child(5),
.external-viewer #view-lineup .lineup-viewer-grid .viewer-lineup-card:nth-child(5) { grid-column: 2; grid-row: 2; }

/* Punktfolge: im Ansichtsmodus direkt unter dem Spielfeld, immer 16 Spalten. */
.viewer-point-sequence-row {
    display: none;
    min-width: 0;
    width: 100%;
}
.view-only-mode #viewerPointSequence,
.external-viewer #viewerPointSequence {
    display: block !important;
}
.viewer-point-sequence-row[hidden] { display: none !important; }
.viewer-point-sequence-grid {
    display: grid;
    grid-template-columns: minmax(92px, 1.35fr) repeat(16, minmax(25px, 1fr));
    grid-template-rows: repeat(2, 27px);
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 4px 5px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-sizing: border-box;
    overflow: hidden;
}
.viewer-point-sequence-head {
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 0 7px;
    border-radius: 6px;
    background: #F4F7F4;
    color: var(--ink);
    font-size: clamp(.55rem, .9vw, .7rem);
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewer-point-sequence-cell {
    min-width: 0;
    display: grid;
    place-items: center;
    border: 1px solid #D7DFD8;
    border-radius: 5px;
    background: #FAFCFA;
    color: #506057;
    font-size: clamp(.58rem, .92vw, .74rem);
    font-weight: 950;
    line-height: 1;
}
.viewer-point-sequence-cell.team.won {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.viewer-point-sequence-cell.opponent.won {
    border-color: #66736A;
    background: #66736A;
    color: #fff;
}
.viewer-point-sequence-cell.empty { opacity: .38; }

@media (max-width: 900px) {
    .viewer-point-sequence-grid {
        grid-template-columns: minmax(72px, 1.15fr) repeat(16, minmax(19px, 1fr));
        grid-template-rows: repeat(2, 24px);
        gap: 1px;
        padding: 3px;
    }
    .viewer-point-sequence-head { padding-inline: 4px; font-size: .52rem; }
    .viewer-point-sequence-cell { font-size: .57rem; border-radius: 4px; }
    .view-only-mode #view-lineup .lineup-set-grid.lineup-viewer-grid,
    .external-viewer #view-lineup .lineup-set-grid.lineup-viewer-grid { gap: 5px !important; }
}

/* --------------------------------------------------------------------------
   0.16.1 – Spielbericht und Punktfolge unterhalb des Courts
   -------------------------------------------------------------------------- */

/* Court und Punktfolge bilden jetzt eine eigene vertikale Einheit. Damit kann
   die Punktfolge in der Ansicht nicht mehr in den Court hineinrutschen. */
.scouting-court-area {
    grid-row: 2 !important;
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-rows: auto auto;
    gap: 5px;
    align-content: start;
    overflow: visible;
}
.scouting-court-area > .combined-volleyball-court {
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
}
.scouting-court-area > #viewerPointSequence {
    grid-row: 2 !important;
    position: relative !important;
    inset: auto !important;
    z-index: 1 !important;
    margin: 0 !important;
}
/* Die Aktionsleiste bleibt im Eingabemodus die dritte Hauptzeile. */
.scouting-main > .recent-actions-row { grid-row: 3 !important; }

/* Spielbericht */
.report-page {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: 42px auto auto minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
}
.report-toolbar { min-width: 0; }
.report-match-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 8px 12px !important;
}
.report-match-team {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
    font-weight: 950;
    line-height: 1.05;
}
.report-match-team span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(1.05rem, 2vw, 1.55rem);
}
.report-match-team strong {
    text-align: right;
    font-size: clamp(1.25rem, 2.3vw, 1.8rem);
}
.report-set-card,
.report-player-card {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
.report-set-card { padding: 6px 8px 8px !important; }
.report-player-card {
    padding: 6px 8px 8px !important;
    display: grid;
    grid-template-rows: 24px minmax(0, 1fr);
}
.report-set-table-wrap,
.report-player-table-wrap {
    min-width: 0;
    min-height: 0;
    width: 100%;
}
.report-player-table-wrap { overflow: auto; }
.report-set-table,
.report-player-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: var(--ink);
    background: var(--surface);
}
.report-set-table th,
.report-set-table td {
    border: 1px solid var(--border);
    padding: 4px 6px;
    text-align: center;
    font-size: .72rem;
    line-height: 1.05;
}
.report-set-table thead th {
    background: #EEF2EE;
    font-weight: 950;
}
.report-set-table thead th:first-child { width: 56px; }
.report-set-table thead th:last-child { width: 120px; }
.report-set-table tbody th { font-weight: 950; }
.report-set-table tr.unplayed { color: var(--muted); opacity: .58; }
.report-final-score { position: relative; font-weight: 950; font-size: .82rem !important; }
.report-set-table tr.finished .report-final-score { color: var(--primary-dark); }
.report-live-mark {
    margin-left: 5px;
    padding: 1px 4px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .48rem;
    text-transform: uppercase;
}
.report-player-table { min-width: 900px; }
.report-player-table th,
.report-player-table td {
    border: 1px solid var(--border);
    padding: 3px 4px;
    text-align: center;
    font-size: .62rem;
    line-height: 1.04;
    white-space: nowrap;
}
.report-player-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #EEF2EE;
    font-weight: 950;
}
.report-player-table thead .report-group-head th {
    top: 0;
    background: #E4EAE4;
    font-size: .66rem;
}
.report-player-table thead tr:nth-child(2) th { top: 22px; }
.report-player-table .report-player-number {
    width: 38px;
    font-size: .78rem;
    font-weight: 950;
}
.report-player-table .report-player-name {
    width: 190px;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    font-weight: 800;
}
.report-lineup-cell { width: 34px; }
.report-lineup-cell span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 22px;
    border: 1px solid #707770;
    background: #F7F8F7;
    font-size: .75rem;
    font-weight: 950;
}
.report-stat-number { width: 52px; font-weight: 800; }
.report-percent { width: 76px; font-weight: 950; }
.report-percent.q0 { color: #C93227; background: rgba(231,76,60,.10); }
.report-percent.q1 { color: #B86A00; background: rgba(255,159,28,.11); }
.report-percent.q2 { color: #9C7900; background: rgba(255,215,55,.15); }
.report-percent.q3 { color: #138A31; background: rgba(82,196,91,.12); }
.report-player-table tfoot th {
    background: #EEF2EE;
    font-weight: 950;
}
.report-player-table tfoot th:first-child { text-align: left; padding-left: 8px; }
.report-empty {
    padding: 12px;
    color: var(--muted);
    font-weight: 800;
}

@media (max-height: 820px) {
    .report-page { gap: 5px; }
    .report-match-header { padding: 5px 9px !important; }
    .report-match-team span { font-size: .95rem; }
    .report-match-team strong { font-size: 1.15rem; }
    .report-set-card { padding: 4px 6px !important; }
    .report-set-table th, .report-set-table td { padding-block: 2px; font-size: .62rem; }
    .report-player-card { padding: 4px 6px 5px !important; grid-template-rows: 21px minmax(0,1fr); }
    .report-player-table th, .report-player-table td { padding: 2px 3px; font-size: .56rem; }
    .report-player-table .report-player-number { font-size: .68rem; }
    .report-lineup-cell span { width: 21px; height: 19px; font-size: .66rem; }
    .report-player-table thead tr:nth-child(2) th { top: 19px; }
}

@media (max-width: 900px) {
    .report-player-table { min-width: 820px; }
    .report-player-table .report-player-name { width: 150px; max-width: 150px; }
    .report-player-table th, .report-player-table td { font-size: .54rem; }
}

/* In read-only views gibt es keine Aktionszeile; die Court-Einheit darf deshalb
   die komplette zweite Hauptzeile belegen. */
.view-only-mode #view-scouting .scouting-main,
.external-viewer #view-scouting .scouting-main {
    grid-template-rows: 42px auto !important;
}


/* --------------------------------------------------------------------------
   0.16.2 – Navigation, persistente Sitzung, Libero-Auswahl, Punktfolge und
   kompakter Spielbericht
   -------------------------------------------------------------------------- */

/* Scouting-Kopf: links steht nur noch die gescoutete Mannschaft. */
#view-scouting .scouting-team-toolbar-left {
    gap: 5px !important;
}
#view-scouting #scoutingTeamButton {
    margin-left: 0 !important;
}

/* Startaufstellung: mehr Platz für Namen plus eigene, spielbezogene Libero-Spalte. */
#view-lineup .lineup-workspace {
    grid-template-columns: minmax(0, 1fr) 330px !important;
}
#view-lineup .lineup-roster-titleline {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    align-items: end;
    gap: 5px;
}
#view-lineup .lineup-libero-head {
    text-align: center;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 900;
    line-height: 1;
}
#view-lineup .lineup-player-row {
    flex: 0 0 31px;
    min-height: 31px;
    height: 31px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    align-items: center;
    gap: 4px;
}
#view-lineup .lineup-player-row .lineup-player-button {
    height: 31px !important;
    min-height: 31px !important;
    min-width: 0 !important;
    grid-template-columns: 42px minmax(0, 1fr) 30px !important;
}
#view-lineup .lineup-player-row .lineup-player-button .name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#view-lineup .lineup-libero-toggle {
    position: relative;
    width: 48px;
    height: 25px;
    padding: 2px !important;
    border: 1px solid #B8C4BB !important;
    border-radius: 999px !important;
    background: #EDF1EE !important;
    box-shadow: none !important;
    cursor: pointer;
}
#view-lineup .lineup-libero-toggle .lineup-libero-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #A5B0A8;
    transition: transform .14s ease;
}
#view-lineup .lineup-libero-toggle.active {
    background: var(--primary) !important;
    border-color: var(--primary-dark) !important;
}
#view-lineup .lineup-libero-toggle.active .lineup-libero-knob {
    transform: translateX(23px);
    border-color: #fff;
}
#view-lineup .lineup-libero-toggle:disabled {
    opacity: .45;
    cursor: default;
}
@media (max-width: 1180px) {
    #view-lineup .lineup-workspace { grid-template-columns: minmax(0, 1fr) 310px !important; }
}

/* Punktfolge ist ein echtes Geschwisterelement NACH dem kompletten Court.
   Eingabemodus: Aktionsleiste in Zeile 3. Ansichtsmodus: Punktfolge in Zeile 3. */
.scouting-main > .scouting-court-area {
    grid-row: 2 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
}
.scouting-main > #viewerPointSequence {
    grid-row: 3 !important;
    position: relative !important;
    inset: auto !important;
    z-index: 1 !important;
    margin: 0 !important;
    align-self: start !important;
}
.scouting-main > .recent-actions-row { grid-row: 3 !important; }
.view-only-mode #view-scouting .scouting-main,
.external-viewer #view-scouting .scouting-main {
    grid-template-rows: 42px auto auto !important;
    align-content: start !important;
}
.view-only-mode #view-scouting #viewerPointSequence,
.external-viewer #view-scouting #viewerPointSequence {
    margin-top: 5px !important;
}

/* Spielbericht: Gesamtspielstand + Sätze nebeneinander, damit die
   Spielerinnen-/Qualitätstabelle den überwiegenden Teil der Höhe erhält. */
.report-page {
    grid-template-rows: 42px minmax(118px, 142px) minmax(0, 1fr) !important;
    gap: 7px !important;
}
.report-summary-grid {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(250px, .78fr) minmax(0, 1.55fr);
    gap: 7px;
    overflow: hidden;
}
.report-summary-grid > .side-card {
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}
.report-match-header {
    align-content: center;
    padding: 8px 12px !important;
}
.report-set-card {
    display: grid;
    grid-template-rows: 22px minmax(0, 1fr);
    padding: 5px 7px !important;
}
.report-set-table-wrap {
    overflow: hidden;
}
.report-set-table th,
.report-set-table td {
    padding: 2px 4px !important;
    height: 18px;
    font-size: .64rem !important;
}
.report-player-card {
    min-height: 0 !important;
    grid-template-rows: 23px minmax(0, 1fr) !important;
}
.report-player-table-wrap {
    min-height: 0;
    overflow: auto;
}
.report-player-table {
    min-width: 900px !important;
    table-layout: fixed !important;
}
.report-player-table col.report-col-number { width: 42px; }
.report-player-table col.report-col-name { width: 270px; }
.report-player-table col.report-col-lineup { width: 31px; }
.report-player-table col.report-col-stat { width: 54px; }
.report-player-table col.report-col-percent { width: 78px; }
.report-player-table .report-player-number {
    width: auto !important;
}
.report-player-table .report-player-name {
    width: auto !important;
    max-width: none !important;
    text-align: left !important;
}
.report-player-table .report-lineup-cell {
    width: auto !important;
    padding-inline: 2px !important;
}
.report-player-table .report-lineup-cell span {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
}
.report-player-table tbody tr {
    height: 30px !important;
}
.report-player-table tbody td {
    height: 30px !important;
    min-height: 30px !important;
    box-sizing: border-box;
    vertical-align: middle;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}
.report-player-table tbody .report-lineup-cell:empty::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}
@media (max-height: 820px) {
    .report-page { grid-template-rows: 42px 116px minmax(0, 1fr) !important; }
    .report-summary-grid { gap: 5px; }
    .report-player-table tbody tr,
    .report-player-table tbody td { height: 26px !important; min-height: 26px !important; }
    .report-player-table .report-lineup-cell span,
    .report-player-table tbody .report-lineup-cell:empty::after {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
    }
}
@media (max-width: 900px) {
    .report-summary-grid { grid-template-columns: minmax(220px, .82fr) minmax(0, 1.5fr); }
    .report-player-table { min-width: 860px !important; }
    .report-player-table col.report-col-name { width: 235px; }
    .report-player-table col.report-col-lineup { width: 29px; }
}

/* 0.16.2 Nachkorrektur: Im lokalen Ansichtsmodus sind die Eingabeflächen unter
   dem Court ebenfalls vollständig ausgeblendet. Die Punktfolge sitzt dadurch
   unmittelbar unter der sichtbaren Spielfeldkante. */
.view-only-mode #view-scouting .court-bottom-actions {
    display: none !important;
}
.view-only-mode #view-scouting .combined-volleyball-court .court-slot {
    grid-template-rows: var(--scouting-court-runtime, auto) 0 !important;
}

@media (max-height: 820px) {
    .report-page { grid-template-rows: 42px 130px minmax(0, 1fr) !important; }
    .report-set-table th,
    .report-set-table td {
        height: 15px !important;
        padding: 1px 3px !important;
        font-size: .57rem !important;
    }
}

/* --------------------------------------------------------------------------
   0.16.3 – besser lesbarer Spielbericht und Punktfolge exakt unter dem Feld
   -------------------------------------------------------------------------- */

/* Spielbericht: Zahlenwerte sollen mindestens so gut lesbar sein wie die
   Startpositionsnummern, ohne die kompakte Zeilenhöhe der Tabelle zu ändern. */
.report-player-table tbody .report-stat-number,
.report-player-table tbody .report-percent,
.report-player-table tfoot .report-stat-number,
.report-player-table tfoot .report-percent {
    font-size: .80rem !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

/* Auch die Satzstände in der oberen rechten Berichtstabelle werden deutlich
   größer. Die Tabellenköpfe bleiben kompakter, damit die Karte niedrig bleibt. */
.report-set-table tbody th,
.report-set-table tbody td {
    font-size: .82rem !important;
    line-height: 1 !important;
    font-weight: 850 !important;
}
.report-set-table tbody .report-final-score {
    font-size: .92rem !important;
    font-weight: 1000 !important;
}

/* Punktfolge: unterhalb der roten AUS-Zone etwas Luft lassen. Die exakte
   Feldbreite und horizontale Ausrichtung werden ergänzend per JS aus den beiden
   grünen Court-Frames berechnet. */
.view-only-mode #view-scouting #viewerPointSequence,
.external-viewer #view-scouting #viewerPointSequence {
    margin-top: 44px !important;
    width: auto;
    max-width: 100%;
}
.viewer-point-sequence-grid {
    max-width: 100%;
}

@media (max-height: 820px) {
    .report-player-table tbody .report-stat-number,
    .report-player-table tbody .report-percent,
    .report-player-table tfoot .report-stat-number,
    .report-player-table tfoot .report-percent {
        font-size: .75rem !important;
    }
    .report-set-table tbody th,
    .report-set-table tbody td {
        font-size: .75rem !important;
    }
    .report-set-table tbody .report-final-score {
        font-size: .84rem !important;
    }
}

/* 0.16.3 Feinschliff: Werte bewusst klar oberhalb der bisherigen Kleinschrift. */
.report-player-table tbody .report-stat-number,
.report-player-table tbody .report-percent {
    font-size: .84rem !important;
}
.report-player-table tfoot th:not(:first-child) {
    font-size: .84rem !important;
    font-weight: 1000 !important;
}
.report-set-table tbody th,
.report-set-table tbody td {
    font-size: .86rem !important;
}
.report-set-table tbody .report-final-score {
    font-size: 1rem !important;
}
@media (max-height: 820px) {
    .report-player-table tbody .report-stat-number,
    .report-player-table tbody .report-percent,
    .report-player-table tfoot th:not(:first-child) {
        font-size: .78rem !important;
    }
    .report-set-table tbody th,
    .report-set-table tbody td {
        font-size: .79rem !important;
    }
    .report-set-table tbody .report-final-score {
        font-size: .90rem !important;
    }
}


/* --------------------------------------------------------------------------
   0.16.4 – Annahmekennzahlen, K1-Läuferauswertung und Punktfolgenfarben
   -------------------------------------------------------------------------- */

/* Annahme: alle geforderten Kennzahlen groß und in exakt einer Zeile. */
.reception-evaluation-row.reception-evaluation-row-0164 {
    grid-template-columns: 48px minmax(150px, 1fr) 92px 82px 92px !important;
    gap: 7px !important;
}
.reception-eval-name-0164 strong {
    font-size: clamp(.72rem, 1vw, .88rem) !important;
    line-height: 1 !important;
}
.reception-eval-metric {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    color: #121713;
    white-space: nowrap;
    line-height: 1;
}
.reception-eval-metric strong {
    font-size: clamp(.82rem, 1.18vw, 1.05rem);
    font-weight: 1000;
}
.reception-eval-metric span {
    font-size: clamp(.52rem, .68vw, .62rem);
    font-weight: 850;
    color: #4e5851;
}
.reception-evaluation-row.reception-evaluation-row-0164 .reception-eval-percent {
    color: #111511 !important;
    font-size: clamp(.88rem, 1.28vw, 1.12rem) !important;
    font-weight: 1000 !important;
    letter-spacing: .01em;
}
.reception-evaluation-row.reception-evaluation-row-0164.unrated .reception-eval-percent,
.reception-evaluation-row.reception-evaluation-row-0164.unrated .reception-eval-metric {
    color: #68736c !important;
}

/* K1-Richtungen nach Läufer: feste Reihenfolge 1–6–5 / 2–3–4. */
#evaluationK1RunnerPanel {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}
#evaluationK1RunnerPanel[hidden] { display: none !important; }
.k1-runner-grid {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    grid-template-rows: repeat(2, minmax(0,1fr));
    gap: 8px;
    padding: 0 7px 6px;
    overflow: hidden;
}
.k1-runner-card {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 28px minmax(0,1fr);
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
}
.k1-runner-head {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 3px;
}
.k1-runner-head strong {
    font-size: clamp(.74rem, 1vw, .9rem);
    color: var(--primary-dark);
    font-weight: 1000;
}
.k1-runner-head span {
    font-size: clamp(.52rem, .72vw, .64rem);
    color: var(--muted);
    font-weight: 850;
    white-space: nowrap;
}
.k1-runner-court-wrap {
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.k1-runner-court-wrap .evaluation-court-svg {
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    overflow: visible !important;
}

/* Punktfolge: obere Mannschaft immer theme-abhängig blau, untere Mannschaft
   verwendet die Hauptfarbe des Farbschemas. */
.viewer-point-sequence-cell.team.won {
    border-color: var(--viewer-team-top, #1976D2) !important;
    background: var(--viewer-team-top, #1976D2) !important;
    color: #fff !important;
}
.viewer-point-sequence-cell.opponent.won {
    border-color: var(--viewer-team-bottom, var(--primary)) !important;
    background: var(--viewer-team-bottom, var(--primary)) !important;
    color: #fff !important;
}

@media (max-width: 900px) {
    .reception-evaluation-row.reception-evaluation-row-0164 {
        grid-template-columns: 42px minmax(118px,1fr) 76px 70px 78px !important;
        gap: 4px !important;
    }
    .reception-eval-metric span { display: none; }
    .k1-runner-grid { gap: 5px; padding-inline: 4px; }
    .k1-runner-card { padding: 4px; grid-template-rows: 24px minmax(0,1fr); }
}

@media (max-height: 760px) {
    .k1-runner-grid { gap: 4px; padding-bottom: 3px; }
    .k1-runner-card { padding: 3px; grid-template-rows: 22px minmax(0,1fr); }
    .k1-runner-head strong { font-size: .7rem; }
    .k1-runner-head span { font-size: .5rem; }
}


/* --------------------------------------------------------------------------
   0.16.5 – K1-Läufercourts wie normale Angriffsrichtungs-Karten
   -------------------------------------------------------------------------- */

/* Exakt drei Courts pro Zeile und zwei vollständige Reihen im verfügbaren
   Auswertungsbereich. */
#evaluationK1RunnerPanel .k1-runner-grid {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 0 !important;
    gap: 8px !important;
    align-content: stretch !important;
    overflow: hidden !important;
    padding: 0 7px 6px !important;
}

/* Höhe, Innenabstände und Court-Skalierung entsprechen der normalen
   Angriffsrichtungs-Auswertung. */
#evaluationK1RunnerPanel .k1-runner-card-0165 {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: grid !important;
    grid-template-rows: 50px minmax(0, 1fr) !important;
    gap: 3px !important;
    padding: 6px !important;
    overflow: hidden !important;
}

#evaluationK1RunnerPanel .k1-runner-head-0165 {
    min-width: 0 !important;
    height: 50px !important;
}

#evaluationK1RunnerPanel .k1-runner-head-0165 .eval-head-top {
    grid-template-columns: 46px minmax(0, 1fr) auto !important;
}

#evaluationK1RunnerPanel .k1-runner-head-0165 .eval-head-top > strong {
    font-size: 1.45rem !important;
}

#evaluationK1RunnerPanel .k1-runner-head-0165 .eval-head-top > b {
    font-size: .72rem !important;
}

#evaluationK1RunnerPanel .k1-runner-card-0165 > .evaluation-court-svg {
    width: auto !important;
    height: 90% !important;
    max-width: 90% !important;
    max-height: 90% !important;
    aspect-ratio: auto !important;
    align-self: start !important;
    justify-self: center !important;
    overflow: visible !important;
}

@media (max-width: 900px) {
    #evaluationK1RunnerPanel .k1-runner-grid {
        gap: 5px !important;
        padding-inline: 4px !important;
    }
    #evaluationK1RunnerPanel .k1-runner-card-0165 {
        grid-template-rows: 44px minmax(0, 1fr) !important;
        padding: 4px !important;
    }
    #evaluationK1RunnerPanel .k1-runner-head-0165 {
        height: 44px !important;
    }
    #evaluationK1RunnerPanel .k1-runner-card-0165 > .evaluation-court-svg {
        height: 92% !important;
        max-height: 92% !important;
        max-width: 94% !important;
    }
}

@media (max-height: 760px) {
    #evaluationK1RunnerPanel .k1-runner-grid {
        gap: 4px !important;
        padding-bottom: 3px !important;
    }
    #evaluationK1RunnerPanel .k1-runner-card-0165 {
        grid-template-rows: 40px minmax(0, 1fr) !important;
        padding: 3px !important;
    }
    #evaluationK1RunnerPanel .k1-runner-head-0165 {
        height: 40px !important;
    }
    #evaluationK1RunnerPanel .k1-runner-card-0165 > .evaluation-court-svg {
        height: 94% !important;
        max-height: 94% !important;
    }
}

/* =========================================================
   0.16.6 – K1-Läuferkarten: nur L1/L6/L5/L2/L3/L4 im Kopf
   ========================================================= */
#evaluationK1RunnerPanel .k1-runner-card-0165 {
    grid-template-rows: 34px minmax(0, 1fr) !important;
}
#evaluationK1RunnerPanel .k1-runner-head-0165 {
    height: 34px !important;
    display: block !important;
}
#evaluationK1RunnerPanel .k1-runner-head-0165 .eval-head-top {
    height: 100% !important;
    align-items: center !important;
}
@media (max-width: 900px) {
    #evaluationK1RunnerPanel .k1-runner-card-0165 {
        grid-template-rows: 30px minmax(0, 1fr) !important;
    }
    #evaluationK1RunnerPanel .k1-runner-head-0165 {
        height: 30px !important;
    }
}
@media (max-height: 760px) {
    #evaluationK1RunnerPanel .k1-runner-card-0165 {
        grid-template-rows: 28px minmax(0, 1fr) !important;
    }
    #evaluationK1RunnerPanel .k1-runner-head-0165 {
        height: 28px !important;
    }
}


/* --------------------------------------------------------------------------
   0.16.7 – Scoutingfeld wieder mit sicheren seitlichen Aufschlag-Gassen
   -------------------------------------------------------------------------- */
/*
   0.16.1 hatte den kombinierten Court innerhalb von .scouting-court-area wieder
   auf 100 % Breite gesetzt. Dadurch ragten die absolut positionierten
   Aufschlagbuttons links aus dem sichtbaren Bereich bzw. rechts in die
   Statistikspalte. Der Court erhält wieder eine eigene, zentrierte Maximalbreite
   und reserviert auf beiden Seiten ausreichend Platz für die vertikalen Buttons.
*/
/* Nur im EINGABEMODUS verkleinern. Die Ansichtsseite ist der gewünschte
   Referenzzustand und bleibt bewusst unverändert. */
html:not(.view-only-mode):not(.external-viewer) #view-scouting .scouting-court-area > .combined-volleyball-court {
    width: min(88%, calc(100% - 104px), calc((100dvh - 225px) * 2)) !important;
    max-width: calc(100% - 104px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Die Aufschlagbuttons bleiben im Eingabemodus vollständig innerhalb der
   Scouting-Hauptspalte. Im Ansichtsmodus sind sie ohnehin ausgeblendet und
   die dortige Court-Geometrie wird nicht angefasst. */
html:not(.view-only-mode):not(.external-viewer) #view-scouting .serve-side-left { left: -42px !important; }
html:not(.view-only-mode):not(.external-viewer) #view-scouting .serve-side-right { right: -42px !important; }

/* Bei etwas schmaleren iPads noch etwas mehr Reserve, ohne die beiden Courts
   untereinander zu setzen. Diese Regeln gelten ebenfalls nur für Eingabe. */
@media (max-width: 1180px) {
    html:not(.view-only-mode):not(.external-viewer) #view-scouting .scouting-court-area > .combined-volleyball-court {
        width: min(86%, calc(100% - 92px), calc((100dvh - 215px) * 2)) !important;
        max-width: calc(100% - 92px) !important;
    }
}

@media (max-width: 980px) {
    html:not(.view-only-mode):not(.external-viewer) #view-scouting .scouting-court-area > .combined-volleyball-court {
        width: min(84%, calc(100% - 82px), calc((100dvh - 205px) * 2)) !important;
        max-width: calc(100% - 82px) !important;
    }
    html:not(.view-only-mode):not(.external-viewer) #view-scouting .serve-side-left { left: -36px !important; }
    html:not(.view-only-mode):not(.external-viewer) #view-scouting .serve-side-right { right: -36px !important; }
}
