/* Dartzähler – Frontend
   Bildsprache: Kreidetafel neben dem Oche. Schiefer, Kreide,
   dazu das Grün und Rot der Double- und Treble-Ringe. */

.dcx {
	--dc-slate: #18211d;
	--dc-slate-2: #212d27;
	--dc-line: #35443c;
	--dc-chalk: #f1efe4;
	--dc-chalk-dim: #a9b3ac;
	--dc-green: #2e8b57;
	--dc-red: #b83a2e;
	--dc-cream: #e6d9b8;
	--dc-radius: 10px;
	--dc-gap: 10px;

	box-sizing: border-box;
	background: var(--dc-slate);
	color: var(--dc-chalk);
	border-radius: var(--dc-radius);
	padding: clamp(14px, 3vw, 24px);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}

.dcx *,
.dcx *::before,
.dcx *::after {
	box-sizing: inherit;
}

.dcx :focus-visible {
	outline: 2px solid var(--dc-cream);
	outline-offset: 2px;
}

.dcx-boot,
.dcx-noscript {
	color: var(--dc-chalk-dim);
	margin: 0;
	padding: 24px 0;
	text-align: center;
}

/* ----------------------------------------------------------------- Struktur */

.dcx-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--dc-gap);
	border-bottom: 1px solid var(--dc-line);
	padding-bottom: 12px;
	margin-bottom: 18px;
}

.dcx-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--dc-chalk);
}

.dcx-sub {
	margin: 2px 0 0;
	font-size: 0.85rem;
	color: var(--dc-chalk-dim);
}

.dcx-tabs {
	display: flex;
	gap: 6px;
}

.dcx-section + .dcx-section {
	margin-top: 22px;
}

.dcx-section > h3 {
	margin: 0 0 10px;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--dc-chalk-dim);
}

/* ------------------------------------------------------------------ Buttons */

.dcx button {
	font: inherit;
	font-variant-numeric: tabular-nums;
	color: var(--dc-chalk);
	background: var(--dc-slate-2);
	border: 1px solid var(--dc-line);
	border-radius: 8px;
	padding: 9px 14px;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
}

.dcx button:hover:not(:disabled) {
	background: #2b3a32;
	border-color: #4a5b52;
}

.dcx button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.dcx button.dcx-on {
	background: var(--dc-green);
	border-color: var(--dc-green);
	color: #fff;
	font-weight: 600;
}

.dcx button.dcx-primary {
	background: var(--dc-green);
	border-color: var(--dc-green);
	color: #fff;
	font-weight: 600;
	padding: 12px 22px;
}

.dcx button.dcx-primary:hover:not(:disabled) {
	background: #35a066;
	border-color: #35a066;
}

.dcx button.dcx-quiet {
	background: transparent;
	color: var(--dc-chalk-dim);
}

.dcx button.dcx-quiet:hover:not(:disabled) {
	color: var(--dc-chalk);
}

.dcx button.dcx-danger {
	color: #e79a90;
}

/* --------------------------------------------------------------- Einrichten */

.dcx-players {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dcx-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--dc-slate-2);
	border: 1px solid var(--dc-line);
	border-radius: 999px;
	padding: 7px 14px;
	cursor: pointer;
	user-select: none;
}

.dcx-chip:hover {
	border-color: #4a5b52;
}

.dcx-chip[aria-pressed="true"] {
	background: var(--dc-green);
	border-color: var(--dc-green);
	color: #fff;
}

.dcx-chip-order {
	font-size: 0.75rem;
	opacity: 0.85;
}

.dcx-chip-del {
	all: unset;
	cursor: pointer;
	font-size: 0.9rem;
	opacity: 0.6;
	padding: 0 2px;
}

.dcx-chip-del:hover {
	opacity: 1;
}

.dcx-add {
	display: flex;
	gap: 8px;
	margin-top: 12px;
	max-width: 420px;
}

.dcx input[type="text"] {
	flex: 1;
	font: inherit;
	color: var(--dc-chalk);
	background: #131a17;
	border: 1px solid var(--dc-line);
	border-radius: 8px;
	padding: 10px 12px;
	min-width: 0;
}

.dcx input[type="text"]::placeholder {
	color: #6d7a72;
}

.dcx-modes {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dcx-options {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 12px;
	font-size: 0.9rem;
	color: var(--dc-chalk-dim);
}

.dcx-options label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
}

.dcx-start {
	margin-top: 22px;
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

/* ------------------------------------------------------------ Spielstandtafel */

.dcx-board {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--dc-gap);
}

.dcx-card {
	background: var(--dc-slate-2);
	border: 1px solid var(--dc-line);
	border-left: 4px solid var(--dc-line);
	border-radius: var(--dc-radius);
	padding: 12px 14px;
}

.dcx-card.is-active {
	border-color: var(--dc-green);
	border-left-color: var(--dc-green);
	background: #24352c;
}

.dcx-card.is-winner {
	border-color: var(--dc-cream);
	border-left-color: var(--dc-cream);
}

.dcx-card-name {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	font-weight: 600;
	font-size: 0.95rem;
}

.dcx-card-name span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dcx-score {
	font-size: clamp(2.4rem, 8vw, 3.4rem);
	font-weight: 800;
	line-height: 1;
	margin: 6px 0 4px;
	letter-spacing: -0.02em;
}

.dcx-card-meta {
	font-size: 0.8rem;
	color: var(--dc-chalk-dim);
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.dcx-marks {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	margin: 8px 0 6px;
	font-size: 0.75rem;
	text-align: center;
}

.dcx-mark b {
	display: block;
	font-weight: 600;
}

.dcx-mark i {
	font-style: normal;
	color: var(--dc-chalk-dim);
}

.dcx-mark.is-closed i {
	color: var(--dc-green);
	font-weight: 700;
}

/* -------------------------------------------------------------- Aufnahme */

.dcx-turn {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 18px 0 12px;
	padding: 12px 14px;
	background: #131a17;
	border: 1px solid var(--dc-line);
	border-radius: var(--dc-radius);
}

.dcx-turn-label {
	font-size: 0.85rem;
	color: var(--dc-chalk-dim);
}

.dcx-darts {
	display: flex;
	gap: 6px;
}

.dcx-dart {
	min-width: 48px;
	text-align: center;
	padding: 5px 8px;
	border-radius: 6px;
	border: 1px dashed var(--dc-line);
	color: var(--dc-chalk-dim);
	font-size: 0.9rem;
}

.dcx-dart.is-set {
	border-style: solid;
	border-color: var(--dc-cream);
	color: var(--dc-chalk);
	background: #1f2a24;
}

.dcx-turn-sum {
	margin-left: auto;
	font-size: 1.1rem;
	font-weight: 700;
}

.dcx-hint {
	margin: 0 0 12px;
	font-size: 0.9rem;
	color: var(--dc-cream);
}

.dcx-bust {
	color: #ef9a90;
	font-weight: 700;
}

/* --------------------------------------------------------------- Tastenfeld */

.dcx-mult {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 8px;
}

.dcx-mult button {
	padding: 12px;
	font-weight: 600;
}

.dcx-keys {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 8px;
}

.dcx-keys button {
	padding: 14px 4px;
	font-size: 1.05rem;
	font-weight: 600;
}

.dcx-keys button.dcx-bull {
	grid-column: span 2;
	border-color: var(--dc-red);
	color: #f3b5ac;
}

.dcx-keys button.dcx-miss {
	grid-column: span 3;
	color: var(--dc-chalk-dim);
}

.dcx-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
	align-items: center;
}

.dcx-actions .dcx-spacer {
	margin-left: auto;
}

/* ------------------------------------------------------------------ Ergebnis */

.dcx-win {
	background: linear-gradient(180deg, #24352c, #1b2621);
	border: 1px solid var(--dc-cream);
	border-radius: var(--dc-radius);
	padding: 18px;
	margin-bottom: 16px;
}

.dcx-leg-tally {
	margin: 0 0 14px;
	font-size: 0.9rem;
	color: var(--dc-cream);
	background: #131a17;
	border: 1px solid var(--dc-line);
	border-radius: 8px;
	padding: 8px 14px;
	display: inline-block;
}

.dcx-win h3 {
	margin: 0 0 4px;
	font-size: 1.4rem;
}

.dcx-win p {
	margin: 0;
	color: var(--dc-chalk-dim);
	font-size: 0.9rem;
}

/* --------------------------------------------------------------- Statistik */

.dcx-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	display: block;
	overflow-x: auto;
	white-space: nowrap;
}

.dcx-table th,
.dcx-table td {
	text-align: right;
	padding: 8px 10px;
	border-bottom: 1px solid var(--dc-line);
}

.dcx-table th:first-child,
.dcx-table td:first-child {
	text-align: left;
	white-space: normal;
}

.dcx-table th {
	color: var(--dc-chalk-dim);
	font-weight: 600;
}

.dcx-recent {
	margin-top: 18px;
	display: grid;
	gap: 8px;
}

.dcx-game {
	background: var(--dc-slate-2);
	border: 1px solid var(--dc-line);
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 0.9rem;
}

.dcx-game-head {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	color: var(--dc-chalk-dim);
	font-size: 0.8rem;
	margin-bottom: 6px;
}

.dcx-game ol {
	margin: 0;
	padding-left: 20px;
}

.dcx-empty {
	color: var(--dc-chalk-dim);
	font-size: 0.9rem;
}

.dcx-error {
	background: #3a201d;
	border: 1px solid var(--dc-red);
	color: #f3c4bd;
	border-radius: 8px;
	padding: 10px 14px;
	margin-bottom: 14px;
	font-size: 0.9rem;
}

@media (max-width: 480px) {
	.dcx-keys {
		gap: 6px;
	}

	.dcx-keys button {
		padding: 12px 2px;
	}

	.dcx-turn-sum {
		width: 100%;
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dcx * {
		transition: none !important;
	}
}
