/* Dartliga Manager */
:root {
	--dl-accent: #c8102e;      /* Schweizer Rot */
	--dl-accent-ink: #fff;
	--dl-ink: #1d2327;
	--dl-muted: #646970;
	--dl-line: #dcdcde;
	--dl-soft: #f6f7f7;
	--dl-win: #e7f5ec;
	--dl-win-ink: #13693a;
	--dl-warn: #fcf0e3;
}

.dl-table { width: 100%; border-collapse: collapse; font-size: 0.95em; margin: 0 0 1.2em; }
.dl-table th, .dl-table td { padding: 6px 8px; border-bottom: 1px solid var(--dl-line); text-align: center; vertical-align: middle; }
.dl-table thead th { background: var(--dl-soft); font-weight: 600; font-size: 0.85em; text-transform: uppercase; letter-spacing: .03em; color: var(--dl-muted); }
.dl-table .dl-left { text-align: left; }
.dl-table .dl-right { text-align: right; }
.dl-table .dl-pts { font-weight: 700; }
.dl-table .dl-winner { font-weight: 700; }
.dl-table .dl-score { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.dl-standings tbody tr:first-child td { box-shadow: inset 0 0 0 9999px rgba(200,16,46,.04); }
.dl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dl-hint { color: var(--dl-muted); font-size: .92em; }
.dl-small { display: block; color: var(--dl-muted); font-size: .78em; letter-spacing: .04em; }
.dl-title { margin-top: 1.4em; }

.dl-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .8em; background: var(--dl-soft); color: var(--dl-muted); }
.dl-st-eingereicht { background: var(--dl-warn); color: #8a4b00; }
.dl-st-bestaetigt { background: var(--dl-win); color: var(--dl-win-ink); }
.dl-st-verschoben { background: #eef; color: #335; }

.dl-btn { display: inline-block; background: var(--dl-accent); color: var(--dl-accent-ink) !important; border: 0; padding: 10px 18px; border-radius: 4px; cursor: pointer; font-weight: 600; text-decoration: none; }
.dl-btn-secondary { background: var(--dl-soft); color: var(--dl-ink) !important; border: 1px solid var(--dl-line); }
.dl-btn-small { padding: 4px 10px; font-size: .85em; }
.dl-success { background: var(--dl-win); color: var(--dl-win-ink); padding: 10px 14px; border-radius: 4px; margin-bottom: 1em; }
.dl-errors { background: #fcf0f1; border-left: 4px solid #d63638; padding: 6px 14px; margin-bottom: 1em; }
.dl-errors ul { margin: 0 0 .5em 1.2em; list-style: disc; }

/* Rapport */
.dl-report-head { border: 2px solid var(--dl-ink); border-radius: 6px; padding: 12px 16px; margin-bottom: 1.2em; background: #fff; }
.dl-head-league { font-weight: 600; color: var(--dl-accent); margin-bottom: 8px; }
.dl-head-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.dl-head-teams > div:last-child { text-align: right; }
.dl-head-teams strong { font-size: 1.25em; }
.dl-vs { color: var(--dl-muted); font-weight: 700; padding: 0 2px; }
.dl-big { font-size: 1.8em; color: var(--dl-ink); white-space: nowrap; }
.dl-head-meta { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--dl-muted); }

.dl-lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl-lineup th { width: 3em; }
.dl-lineup select, .dl-games select { width: 100%; max-width: 260px; }
.dl-games .dl-round td { background: var(--dl-ink); color: #fff; text-align: left; font-weight: 600; padding: 5px 10px; }
.dl-games .dl-round .dl-hint { color: #c3c4c7; font-weight: 400; }
.dl-games .dl-players { text-align: left; }
.dl-games .dl-players select { display: inline-block; width: calc(100% - 2.6em); margin: 2px 0; }
.dl-pos { display: inline-block; width: 2.2em; font-weight: 700; color: var(--dl-muted); font-size: .85em; }
.dl-games .dl-nr { color: var(--dl-muted); width: 2em; }
.dl-legs { width: 3.6em; text-align: center; }
.dl-game.dl-home-win .dl-legs-h, .dl-game.dl-away-win .dl-legs-a { background: var(--dl-win); font-weight: 700; }
.dl-game.dl-invalid .dl-legs { border-color: #d63638; background: #fcf0f1; }
.dl-game.dl-disabled { opacity: .45; }
.dl-game-res { font-weight: 700; width: 3.5em; white-space: nowrap; }
select.dl-ersatz { border-color: #dba617; background: #fcf9e8; }

.dl-summary { display: flex; gap: 12px; margin: 1em 0; }
.dl-summary > div { flex: 1; border: 2px solid var(--dl-ink); border-radius: 6px; padding: 8px 12px; text-align: center; background: #fff; }
.dl-summary strong { font-size: 1.6em; font-variant-numeric: tabular-nums; }
.dl-captains { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 1em 0; }
.dl-captains label, .dl-notes { display: block; font-weight: 600; }
.dl-captains input, .dl-notes textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font-weight: 400; }
.dl-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1em; }

.dl-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dl-team-card { border: 1px solid var(--dl-line); border-radius: 6px; padding: 12px 14px; }
.dl-team-card h4 { margin: 0 0 4px; }
.dl-team-card ul { margin: 6px 0 6px 1.1em; }
.dl-team-card .dl-small { display: inline; }

/* Admin */
.dl-admin .dl-card { background: #fff; border: 1px solid var(--dl-line); border-radius: 4px; padding: 4px 18px 14px; margin: 14px 0; }
.dl-admin .dl-cols { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.dl-admin .dl-cols > * { min-width: 320px; }
.dl-admin .dl-grow { flex: 1; }
.dl-admin .dl-filter { margin: 8px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.dl-admin .dl-danger { color: #b32d2e; }
.dl-admin tr.dl-inactive td { color: #a7aaad; }
.dl-admin .form-table th { width: 170px; }

@media (max-width: 700px) {
	.dl-lineups, .dl-captains { grid-template-columns: 1fr; }
	.dl-games, .dl-games tbody, .dl-games tr, .dl-games td { display: block; width: auto; }
	.dl-games thead { display: none; }
	.dl-games tr.dl-game { display: grid; grid-template-columns: 1fr auto auto auto; grid-template-areas: "h hl c al" "a a a r"; gap: 4px; border-bottom: 1px solid var(--dl-line); padding: 6px 0; }
	.dl-games tr.dl-game td { border: 0; padding: 2px 4px; }
	.dl-games tr.dl-game .dl-nr { display: none; }
	.dl-games tr.dl-game td:nth-child(2) { grid-area: h; }
	.dl-games tr.dl-game td:nth-child(3) { display: none; }
	.dl-games tr.dl-game td:nth-child(4) { grid-area: a; }
	.dl-games tr.dl-game td:nth-child(5) { grid-area: hl; }
	.dl-games tr.dl-game td:nth-child(6) { grid-area: c; }
	.dl-games tr.dl-game td:nth-child(7) { grid-area: al; }
	.dl-games tr.dl-game td:nth-child(8) { grid-area: r; }
	.dl-head-teams strong { font-size: 1.05em; }
}

/* Einzelturnier */
.dl-ts-anmeldung { background: #eef; color: #335; }
.dl-ts-laufend { background: var(--dl-warn); color: #8a4b00; }
.dl-ts-beendet { background: var(--dl-win); color: var(--dl-win-ink); }
.dl-small.dl-inline { display: inline; }
.dl-rec, .dl-t-round .dl-small { color: var(--dl-muted); font-size: .8em; white-space: nowrap; }
.dl-bye { color: var(--dl-muted); font-style: italic; }
.dl-open { color: var(--dl-muted); font-weight: 400; font-size: .85em; }
.dl-t-round td:nth-child(2), .dl-t-round td:nth-child(4) { width: 44%; }
.dl-t-standings tr.dl-champion td { background: #fff6d6; }
.dl-champion-banner { font-size: 1.3em; padding: 12px 16px; background: #fff6d6; border-radius: 6px; }
.dl-t-past { margin: .4em 0; }
.dl-t-past summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.dl-admin details.dl-round-card > summary { cursor: pointer; list-style: none; }
.dl-admin details.dl-round-card > summary h2 { display: inline-block; }
.dl-admin details.dl-round-card > summary::before { content: "▸ "; color: var(--dl-muted); }
.dl-admin details.dl-round-card[open] > summary::before { content: "▾ "; }
.dl-admin .dl-t-matches td { vertical-align: middle; }
.dl-admin .dl-t-matches tr.dl-invalid td { background: #fcf0f1; }
.dl-admin .dl-t-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dl-admin .dl-t-players { margin-top: 10px; }

@media print {
	#adminmenumain, #wpadminbar, #wpfooter, .notice, .dl-noprint, .dl-admin .button { display: none !important; }
	#wpcontent { margin-left: 0 !important; padding: 0 !important; }
	.dl-admin details.dl-round-card { border: 0; }
	.dl-admin details.dl-round-card > summary::before { content: ""; }
	.dl-admin .dl-legs { border: 1px solid #000; }
}
.dl-admin h1 .dl-badge { font-size: 13px; vertical-align: middle; }

/* Formulare Frontend (Anmeldung, Mein Team, Turnierleitung) */
.dl-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; margin-bottom: 1em; }
.dl-grid2 label { display: block; font-weight: 600; }
.dl-grid2 input, .dl-grid2 select { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font-weight: 400; padding: 8px; }
.dl-roster input[type=text] { width: 100%; box-sizing: border-box; min-width: 90px; padding: 6px; }
.dl-roster .dl-lic { max-width: 110px; }
.dl-roster tr.dl-existing td { background: #fafafa; }
.dl-register h3, .dl-myteam h3 { margin-top: 1.4em; }
.dl-roster-box { margin-top: 1.5em; }
.dl-flash { margin-bottom: 1em; }
.dl-inline-form { display: inline-block; margin: 0; }
.dl-link { background: none; border: 0; color: var(--dl-accent); cursor: pointer; padding: 0; text-decoration: underline; font-size: .9em; }
.dl-btn-big { font-size: 1.1em; padding: 14px 22px; }
.dl-card-front { border: 1px solid var(--dl-line); border-radius: 6px; padding: 10px 14px; margin: 1em 0; }
.dl-card-front > summary { cursor: pointer; }

/* Turnierleitung */
.dl-tf-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.dl-tf-list { display: grid; gap: 8px; margin-bottom: 1em; }
.dl-tf-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; border: 1px solid var(--dl-line); border-radius: 6px; padding: 10px 14px; text-decoration: none; color: var(--dl-ink); }
.dl-tf-item .dl-small { grid-column: 1; }
.dl-tf-item .dl-badge { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.dl-tf-match { border: 1px solid var(--dl-line); border-left: 4px solid var(--dl-accent); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.dl-tf-match.dl-done { border-left-color: var(--dl-win-ink); background: #fbfdfb; }
.dl-tf-players { display: grid; grid-template-columns: 2em 1fr auto 1fr; gap: 8px; align-items: center; }
.dl-tf-players > span:nth-child(4) { text-align: right; }
.dl-tf-players small { color: var(--dl-muted); }
.dl-tf-quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.dl-tf-quick button { flex: 1 1 0; min-width: 52px; min-height: 44px; font-size: 1.05em; font-weight: 700; border: 1px solid var(--dl-line); border-radius: 6px; background: var(--dl-soft); cursor: pointer; }
.dl-tf-quick button.dl-q1 { border-color: #c7d7ee; }
.dl-tf-quick button.dl-q2 { border-color: #eed3c7; }
.dl-tf-quick button.dl-cur { background: var(--dl-win-ink); color: #fff; border-color: var(--dl-win-ink); }
.dl-tf-quick button.dl-clear { flex: 0 0 44px; min-width: 44px; color: var(--dl-muted); }
.dl-tf-plist { list-style: none; margin: .5em 0; padding: 0; columns: 2 240px; }
.dl-tf-plist li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--dl-line); break-inside: avoid; }
.dl-tf-plist li.dl-inactive span { color: var(--dl-muted); }
.dl-tf-past { padding: 3px 0; font-size: .92em; }

/* Live */
.dl-live { position: relative; }
.dl-live-bar { display: inline-flex; align-items: center; gap: 6px; font-size: .8em; font-weight: 700; letter-spacing: .06em; color: var(--dl-accent); margin-bottom: 8px; }
.dl-live-time { color: var(--dl-muted); font-weight: 400; letter-spacing: 0; }
.dl-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dl-accent); display: inline-block; animation: dl-pulse 1.6s infinite; }
.dl-live-offline .dl-live-dot { background: #a7aaad; animation: none; }
.dl-live-offline .dl-live-bar { color: var(--dl-muted); }
@keyframes dl-pulse { 0% { box-shadow: 0 0 0 0 rgba(200,16,46,.5); } 70% { box-shadow: 0 0 0 8px rgba(200,16,46,0); } 100% { box-shadow: 0 0 0 0 rgba(200,16,46,0); } }
.dl-live-body { transition: background-color .6s; }
.dl-live-flash .dl-live-body { background-color: #fff8e1; }
.dl-live-running { border: 1px solid #f3c6cd; background: #fff7f8; border-radius: 6px; padding: 6px 12px; margin-bottom: 1em; }
.dl-live-running h4 { margin: 4px 0; display: flex; align-items: center; gap: 8px; }
.dl-live-score { color: var(--dl-accent); font-size: 1.15em; }
.dl-live-sub { margin: 1.2em 0 .4em; }
@media (prefers-reduced-motion: reduce) { .dl-live-dot { animation: none; } .dl-live-body { transition: none; } }
@media (max-width: 520px) {
	.dl-tf-players { grid-template-columns: 1.6em 1fr auto; }
	.dl-tf-players > span:nth-child(4) { grid-column: 2; text-align: left; }
	.dl-tf-players .dl-vs { grid-row: 1 / span 2; grid-column: 3; }
}
@media (max-width: 600px) {
	.dl-roster, .dl-roster tbody, .dl-roster tr, .dl-roster td { display: block; }
	.dl-roster thead { display: none; }
	.dl-roster tr { display: grid; grid-template-columns: 2em 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--dl-line); }
	.dl-roster td { border: 0; padding: 0; text-align: left; }
	.dl-roster td.dl-nr { grid-row: 1 / span 3; align-self: center; }
	.dl-roster td:nth-child(6) { grid-column: 2 / span 2; display: flex; align-items: center; gap: 6px; }
	.dl-roster td:nth-child(6):empty { display: none; }
	.dl-roster td:nth-child(4), .dl-roster td:nth-child(5), .dl-roster td:nth-child(6) { font-size: .9em; }
	.dl-roster td:nth-child(6):not(:empty)::after { content: "Spieler entfernen"; color: var(--dl-muted); }
	.dl-roster .dl-lic { max-width: none; }
	.dl-roster select { width: 100%; padding: 6px; }
}
