/* Spektrum – Spielseite. Gebaut fürs Querformat: links die Skala, rechts der Text. */

/* Keine Kopfzeile: Punktestand und Knöpfe klein in den oberen Ecken,
   dort ist neben dem Halbkreis ohnehin Platz. */
.corner-left, .corner-right {
	position: fixed;
	top: 8px;
	z-index: 5;
	display: flex;
	gap: 14px;
	font-size: 13px;
	color: var(--ink-2);
	line-height: 1;
}
.corner-left { left: max(14px, env(safe-area-inset-left)); }
.corner-right { right: max(14px, env(safe-area-inset-right)); }
.score { font-variant-numeric: tabular-nums; }
.score b { color: var(--ink); font-weight: 700; }
.score .on b { color: var(--red); }
.score span + span::before { content: " · "; color: var(--rule); }
.corner-right button { width: auto; min-height: 0; padding: 0; font-size: 13px; }

body { height: 100dvh; }
main { flex: 1; min-height: 0; overflow: auto; }

/* ----- Start ----- */
.setup { max-width: 620px; margin: 0 auto; padding: 36px 24px 24px; display: grid; gap: 28px; }
.intro p { margin: 10px 0 14px; font-size: 18px; color: var(--ink-2); }
.intro button { width: auto; padding-left: 0; padding-right: 0; }
.form { border-top: 1.5px solid var(--ink); padding-top: 20px; display: grid; gap: 16px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.seg label { position: relative; text-align: center; padding: 11px 6px; font-weight: 600; font-size: 15px; cursor: pointer; border-left: 1.5px solid var(--ink); user-select: none; -webkit-user-select: none; }
.seg label:first-child { border-left: 0; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
#modeDesc { margin: -6px 0 0; min-height: 1.4em; }
.settings { margin-top: 4px; font-size: 14px; }
.settings summary { color: var(--ink-2); font-weight: 500; }
.settings summary::before { content: "+ "; }
.settings[open] summary::before { content: "– "; }
.opt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.opt:last-child { border-bottom: 0; }
.seg.small { min-width: 190px; }
.seg.small.two { grid-template-columns: 1fr 1fr; min-width: 120px; }
.seg.small label { padding: 7px 8px; font-size: 13px; }
.optbtn { width: 100%; min-height: 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none; font: inherit; font-size: 14px; font-weight: 400; text-align: left; grid-template-columns: auto 1fr auto; }
.optbtn .note { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.optbtn .chev { color: var(--ink-2); font-size: 18px; line-height: 1; }

/* Overlay für die Kategorienliste: auf dem kleinen Display eine eigene Seite. */
.sheet {
	position: fixed; inset: 0; z-index: 15;
	background: var(--paper);
	display: flex; flex-direction: column;
	padding: 16px max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
	gap: 8px;
}
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex: none; }
.sheet-head h2 { font-size: 22px; }
.sheet .catlist { flex: 1; min-height: 0; overflow: auto; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.sheet > button { flex: none; width: auto; align-self: flex-end; min-width: 160px; }
@media (orientation: landscape) { .sheet .catlist { column-count: 2; column-gap: 32px; } .sheet .catlist label { break-inside: avoid; } }

.catlist { display: block; }
.catlist label { display: grid; grid-template-columns: 1fr auto 18px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); cursor: pointer; user-select: none; -webkit-user-select: none; font-size: 16px; }
.catlist .n { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.catlist input { appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--ink); border-radius: 3px; display: grid; place-items: center; }
.catlist input:checked { background: var(--ink); }
.catlist input:checked::before { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--paper); border-bottom: 2px solid var(--paper); transform: translateY(-1px) rotate(-45deg); }
.teams { gap: 24px; }

@media (orientation: landscape) and (min-width: 640px) {
	.setup { grid-template-columns: 1fr 1fr; gap: 48px; max-width: 900px; align-items: center; min-height: 100%; padding-top: 24px; }
	.form { border-top: 0; padding-top: 0; }
}

/* ----- Spiel ----- */
/* Halbkreis links, so groß wie die Höhe erlaubt; rechts Text und Bedienung.
   Die Breite des Halbkreises folgt der Höhe, damit nie gescrollt wird. */
.play {
	height: 100%;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 24px;
	padding: 10px max(20px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.play.single { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.board {
	width: min(58vw, calc((100dvh - 54px) * 1.6));
	min-width: 0;
	align-self: end;
}
#dial {
	display: block;
	width: 100%;
	height: auto;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}
#dial.interactive { cursor: grab; }
#dial.interactive:active { cursor: grabbing; }
.labels {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin-top: 2px;
}
.labels span { flex: 1; }
.labels span:last-child { text-align: right; }

.panel {
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 12px;
	max-height: 100%;
}
.play.single .panel { width: min(100%, 560px); }
.panel .text { min-width: 0; }
.panel h2 { font-size: 22px; }
.panel p { margin: 6px 0 0; font-size: 15px; }
.panel .actions { display: flex; flex-direction: column; gap: 8px; }
.panel .side { flex-direction: row; }
.panel .side > * { flex: 1; }
.fine { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.readout { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; min-width: 3ch; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; font-variation-settings: "opsz" 96; }
.results { display: grid; gap: 0; }
.result { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); padding: 2px 0; font-size: 18px; font-weight: 600; }
.result .pts { font-size: 28px; font-weight: 700; color: var(--red); letter-spacing: -0.03em; font-variation-settings: "opsz" 96; }
.note { color: var(--ink-2); font-size: 14px; }
.big { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variation-settings: "opsz" 96; }
.play button { min-height: 46px; font-size: 17px; }
.play button.quiet { min-height: 32px; }

/* Hochkant (wenn jemand trotzdem so spielt): alles untereinander. */
@media (orientation: portrait) {
	.play { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 20px; }
	.board { width: 100%; align-self: auto; }
}

.dots { display: flex; gap: 6px; margin-bottom: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rule); }
.dots i.on { background: var(--ink); }

/* ----- Skala ----- */
.seg-2, .seg-3, .seg-4 { animation: appear .45s ease-out both; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .seg-2, .seg-3, .seg-4 { animation: none; } }
.dial-band { fill: var(--band); }
.dial-cover { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; }
.seg-2 { fill: var(--red-3); }
.seg-3 { fill: var(--red-2); }
.seg-4 { fill: var(--red); }
.needle { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.pivot { fill: var(--ink); }
.cover-text { fill: var(--ink-2); font-size: 24px; font-weight: 600; text-anchor: middle; font-family: inherit; }
.tick { stroke: var(--ink); stroke-width: 1.5; opacity: .55; }
.num { fill: var(--ink-2); font-size: 13px; font-weight: 600; text-anchor: middle; font-family: inherit; }

/* ----- Hochkant: bitte drehen ----- */
.rotate {
	position: fixed;
	inset: 0;
	z-index: 20;
	background: var(--paper);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 24px;
	text-align: center;
}
.rotate p { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.rotate button { width: auto; }
.phone {
	width: 44px; height: 80px;
	border: 3px solid var(--ink);
	border-radius: 8px;
	animation: turn 2.2s ease-in-out infinite;
}
@keyframes turn {
	0%, 25% { transform: rotate(0); }
	55%, 80% { transform: rotate(-90deg); }
	100% { transform: rotate(0); }
}
