/* TuSpo Elfmeterschießen – alles unter .tse-root, damit das Theme nichts verbiegt */
.tse-root {
	--tse-main: #1d4f91;
	--tse-main-dark: #163b6d;
	--tse-on-main: #fff;
	--tse-radius: 14px;
	container-type: inline-size;
	max-width: 900px;
	margin: 1.5em auto;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.4;
	color: #1b1f24;
}
.tse-root *, .tse-root *::before, .tse-root *::after { box-sizing: border-box; }

.tse-game { display: flex; flex-direction: column; gap: 16px; }

.tse-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 800 / 520;
	border-radius: var(--tse-radius);
	overflow: hidden;
	background: #2f7f33;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}
@container (max-width: 560px) {
	.tse-stage { aspect-ratio: 1 / 1; border-radius: 10px; }
}
@supports not (container-type: inline-size) {
	@media (max-width: 560px) { .tse-stage { aspect-ratio: 1 / 1; } }
}

.tse-root .tse-canvas {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	display: block;
	touch-action: manipulation;
	cursor: crosshair;
	outline: none;
	max-width: none;
}
.tse-root .tse-canvas:focus-visible { box-shadow: inset 0 0 0 3px #ffd400; }

/* Ton-Knopf */
.tse-root .tse-sound {
	position: absolute; right: 12px; bottom: 12px; z-index: 3;
	width: 40px; height: 40px; padding: 0; margin: 0;
	display: grid; place-items: center;
	border: 0; border-radius: 50%;
	background: rgba(0, 0, 0, .45); color: #fff;
	cursor: pointer; line-height: 1; box-shadow: none;
}
.tse-root .tse-sound:hover { background: rgba(0, 0, 0, .65); }

/* Overlays */
.tse-overlay {
	position: absolute; inset: 0; z-index: 4;
	display: flex; align-items: center; justify-content: center;
	padding: 14px;
	background: rgba(10, 20, 30, .55);
	backdrop-filter: blur(2px);
	overflow: auto;
}
.tse-overlay[hidden] { display: none; }
.tse-card {
	width: 100%; max-width: 440px;
	background: #fff; color: #1b1f24;
	border-radius: var(--tse-radius);
	padding: 22px 22px 18px;
	text-align: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
	border-top: 6px solid var(--tse-main);
}
.tse-root .tse-h {
	margin: 0 0 6px; padding: 0;
	font-size: 28px; line-height: 1.15; font-weight: 900;
	color: var(--tse-main-dark); letter-spacing: -.01em;
	text-transform: none; border: 0; font-family: inherit;
}
.tse-root .tse-lead { margin: 0 0 10px; font-size: 16px; }
.tse-root .tse-howto {
	list-style: none; margin: 0 0 10px; padding: 0;
	display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.tse-root .tse-howto li {
	margin: 0; padding: 6px 12px; font-size: 15px;
	background: #f0f3f7; border-radius: 999px;
}
.tse-root .tse-points { margin: 0 0 16px; font-size: 13.5px; color: #4a5561; }

.tse-root .tse-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 10px 20px; margin: 0;
	border: 0; border-radius: 999px;
	background: var(--tse-main); color: var(--tse-on-main);
	font: inherit; font-size: 16px; font-weight: 800; line-height: 1;
	cursor: pointer; text-decoration: none; text-transform: none;
	box-shadow: 0 3px 0 var(--tse-main-dark);
	transition: transform .08s, filter .15s;
}
.tse-root .tse-btn:hover { filter: brightness(1.08); }
.tse-root .tse-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tse-main-dark); }
.tse-root .tse-btn:disabled { opacity: .6; cursor: wait; }
.tse-root .tse-btn:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }
.tse-root .tse-btn-big { font-size: 20px; padding: 14px 34px; }
.tse-root .tse-btn-ghost {
	background: transparent; color: var(--tse-main-dark);
	box-shadow: inset 0 0 0 2px var(--tse-main); margin-top: 10px;
}

.tse-root .tse-final { font-size: 17px; margin: 4px 0 6px; }
.tse-root .tse-big-num { font-size: 40px; font-weight: 900; color: var(--tse-main-dark); letter-spacing: -.02em; }
.tse-root .tse-info { margin: 0 0 12px; font-size: 15px; color: #4a5561; }

.tse-root .tse-form { display: flex; gap: 8px; margin: 0; }
.tse-root .tse-form[hidden] { display: none; }
.tse-root .tse-form input[type="text"] {
	flex: 1; min-width: 0; height: 44px; margin: 0;
	padding: 0 14px; border: 2px solid #cfd6de; border-radius: 999px;
	font: inherit; font-size: 16px; color: #1b1f24; background: #fff; box-shadow: none;
}
.tse-root .tse-form input[type="text"]:focus { border-color: var(--tse-main); outline: none; }
.tse-root .tse-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.tse-root .tse-msg { min-height: 1.4em; margin: 8px 0 0; font-size: 15px; font-weight: 600; }
.tse-root .tse-msg:empty { min-height: 0; margin: 0; }
.tse-root .tse-msg.tse-ok { color: #1a7f37; }
.tse-root .tse-msg.tse-err { color: #c62828; }

@container (max-width: 560px) {
	.tse-card { padding: 14px 14px 12px; }
	.tse-root .tse-h { font-size: 22px; }
	.tse-root .tse-lead { font-size: 14px; margin-bottom: 8px; }
	.tse-root .tse-howto li { font-size: 13px; padding: 4px 10px; }
	.tse-root .tse-points { font-size: 12px; margin-bottom: 12px; }
	.tse-root .tse-big-num { font-size: 32px; }
	.tse-root .tse-info { font-size: 13.5px; margin-bottom: 8px; }
	.tse-root .tse-btn-big { font-size: 18px; padding: 12px 28px; }
}

/* Bestenliste */
.tse-board {
	background: #fff;
	border-radius: var(--tse-radius);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
	border: 1px solid #e4e8ee;
	overflow: hidden;
}
.tse-root .tse-board-h {
	margin: 0; padding: 12px 16px;
	font-size: 18px; font-weight: 800; line-height: 1.2;
	background: var(--tse-main); color: var(--tse-on-main);
	font-family: inherit; text-transform: none; border: 0;
}
.tse-root .tse-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.tse-root .tse-row {
	display: grid;
	grid-template-columns: 2.4em 1fr auto 5.5em;
	gap: 10px; align-items: center;
	margin: 0; padding: 9px 16px;
	border-bottom: 1px solid #eef1f5;
	font-size: 15.5px;
}
.tse-root .tse-row:last-child { border-bottom: 0; }
.tse-root .tse-row::before, .tse-root .tse-row::marker { content: none; }
.tse-root .tse-rank { font-weight: 800; color: #6b7684; }
.tse-root .tse-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tse-root .tse-goals { color: #6b7684; font-size: 14px; }
.tse-root .tse-score { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.tse-root .tse-row:nth-child(1) .tse-rank { color: #c89b00; }
.tse-root .tse-row:nth-child(2) .tse-rank { color: #8d99a6; }
.tse-root .tse-row:nth-child(3) .tse-rank { color: #b0703a; }
.tse-root .tse-row.tse-empty .tse-name { color: #b3bcc6; font-weight: 400; }
.tse-root .tse-row.tse-me { background: #fff7cc; }
.tse-root .tse-note { margin: 0; padding: 10px 16px 12px; font-size: 13.5px; color: #6b7684; background: #f7f9fb; }

@container (max-width: 480px) {
	.tse-root .tse-row { grid-template-columns: 1.8em 1fr auto auto; gap: 8px; padding: 8px 12px; font-size: 15px; }
	.tse-root .tse-goals { font-size: 12.5px; }
	.tse-root .tse-board-h { padding: 10px 12px; font-size: 17px; }
	.tse-root .tse-note { padding: 9px 12px 11px; }
}

@media (prefers-reduced-motion: reduce) {
	.tse-root .tse-btn { transition: none; }
}
