/* ==========================================================================
 * Das hidden-Attribut durchsetzen. Es ist auch hier das einzige Mittel fuer
 * Sichtbarkeit — jede Autorenregel mit display wuerde es sonst schlagen.
 * ========================================================================== */
[hidden] {
	display: none !important;
}

/* ============================================================================
 * INFERNUS Blackjack — verify.css
 *
 * Mobil zuerst: entworfen fuer 412x915 CSS-Pixel im Hochformat, danach nach
 * oben skaliert. Alles bis Abschnitt 9 gilt fuer das Telefon.
 *
 * Diese Seite hat eine einzige Aufgabe: einen Zweifler ueberzeugen. Die
 * Gestaltung ordnet sich dem unter — ruhige Flaechen, viel Text, und Glut nur
 * dort, wo etwas zu tun oder zu entscheiden ist. Der Selbsttest steht ganz oben
 * und darf im Fehlerfall laut werden; alles andere bleibt leise.
 *
 * Aufbau: 1 Token · 2 Grundlagen · 3 Kopf · 4 Panels · 5 Formulare
 *         6 Nachweiszeilen · 7 Karten · 8 Fliesstext · 9 Fuss · 10 Breite Schirme
 * ==========================================================================*/

/* ==========================================================================
   1 — TOKEN (Spiegel der Marke; diese Seite laedt kein anderes Stylesheet)
   ========================================================================== */
:root {
	--bg: #141419;
	--bg-sunk: #0e0e12;
	--bg-raised: #1c1c23;
	--bg-panel: #21212a;
	--line: #34343f;
	--line-soft: #26262f;

	--text: #f7f7f7;
	--text-2: #b9b9c4;
	--text-3: #94949e;
	--text-ink: #17171d;

	--accent: #ff7a00;
	--accent-lit: #ffb45b;
	--accent-deep: #b34e00;
	--accent-veil: rgb(255 122 0 / 0.12);

	--felt: #123a2c;

	--ok: #35c07a;
	--bad: #e2483c;
	--ok-veil: rgb(53 192 122 / 0.12);
	--bad-veil: rgb(226 72 60 / 0.14);

	--radius: 12px;
	--radius-sm: 8px;
	/* Bedienbares nie kleiner. Der Daumen trifft nichts Kleineres zuverlaessig. */
	--tap: 44px;

	--gap: 12px;
	--pad: 16px;

	--font: 'Segoe UI', system-ui, -apple-system, sans-serif;
	--mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;
}

/* ==========================================================================
   2 — GRUNDLAGEN
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	/* dvh statt vh: die Adressleiste des Telefons faehrt ein und aus. */
	min-height: 100dvh;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.55;
	overflow-wrap: break-word;
}

/* Kopf, Inhalt, Fuss uebereinander: der Fuss sitzt auch dann unten, wenn der
   Selbsttest fehlschlaegt und die Seite dadurch kurz bleibt. */
.verify {
	display: flex;
	flex-direction: column;
}

.verify .wrap {
	flex: 1 0 auto;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
	margin: 0;
}

ul,
ol {
	padding: 0;
	list-style: none;
}

code {
	font-family: var(--mono);
	font-size: 0.9em;
	background: var(--bg-sunk);
	border: 1px solid var(--line-soft);
	border-radius: 4px;
	padding: 0.1em 0.35em;
	color: var(--accent-lit);
	/* Lange Hexketten duerfen umbrechen, sonst schiebt sich die Seite seitlich auf. */
	overflow-wrap: anywhere;
}

a {
	color: var(--accent-lit);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--accent);
}

/* Sichtbarer Fokus. Wer mit der Tastatur prueft, muss sehen, wo er steht. */
:focus-visible {
	outline: 2px solid var(--accent-lit);
	outline-offset: 2px;
	border-radius: 4px;
}

.tabnum {
	font-variant-numeric: tabular-nums;
}

.skiplinks a {
	position: absolute;
	left: -9999px;
	top: 0;
	/* 700: UEBER der gemeinsamen Kopfzeile (z-index 500) und ueber ihrem
	   Profilkasten (600), aber unter dem Spielerschutz (9800/9900).

	   DER SCHADEN, den diese Zahl verhindert: Die Kopfzeile klebt seit dem
	   Umbau oben am Fensterrand. Der Sprunglink steht bei top: 0 im selben
	   Bereich — mit einer kleineren Zahl lag er beim Fokussieren HINTER der
	   Leiste. Ein Sprunglink, den man nicht sieht, ist fuer den, der ihn
	   braucht, keiner: Der Vorleser nennt ihn, der Bildschirm zeigt nichts,
	   und der Nutzer weiss nicht, worauf sein Fokus steht. Die Zahl stand hier
	   in sechs Fassungen (10, 90, 100, 300, 500, 900) — dieselbe Krankheit wie
	   bei der Kopfzeile, nur leiser. */
	z-index: 700;
	background: var(--bg-panel);
	color: var(--text);
	padding: 12px 16px;
	border: 1px solid var(--accent);
	border-radius: var(--radius-sm);
}

.skiplinks a:focus {
	left: 8px;
	top: 8px;
}

/* ==========================================================================
   3 — KOPF
   ========================================================================== *//* Der einzige Weg zurueck — also ein echtes Ziel fuer den Daumen, nicht nur
   eine Textzeile. Der negative Rand haelt die Kopfleiste trotzdem flach. */.wrap {
	padding: var(--pad);
	padding-left: max(var(--pad), env(safe-area-inset-left));
	padding-right: max(var(--pad), env(safe-area-inset-right));
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* ==========================================================================
   4 — PANELS
   ========================================================================== */
/* Der Aufschlag steht ohne Panelrahmen frei — er ist Anrede, nicht Werkzeug. */
.intro {
	display: flex;
	flex-direction: column;
	margin-bottom: 2px;
}

.intro__title {
	font-size: 28px;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin-bottom: 10px;
}

.intro__lead {
	color: var(--text-2);
	margin-bottom: 12px;
}

.intro__claim {
	background: var(--accent-veil);
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	padding: 12px 14px;
	color: var(--text-2);
	font-size: 15px;
}

.intro__claim strong {
	color: var(--text);
}

.panel {
	background: var(--bg-raised);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	padding: var(--pad);
	scroll-margin-top: 12px;
}

.panel__title {
	font-size: 19px;
	line-height: 1.25;
	margin-bottom: 8px;
}

.panel__hint {
	color: var(--text-2);
	font-size: 15px;
	margin-bottom: 14px;
}

/* ---- Selbsttest: das Urteil dieser Seite ueber sich selbst --------------- */
.selftest {
	border-color: var(--line);
}

.selftest[data-state='ok'] {
	border-color: rgb(53 192 122 / 0.4);
	background: linear-gradient(var(--ok-veil), transparent 60%), var(--bg-raised);
}

/* Im Fehlerfall laut: hier darf die Seite niemandem etwas vorrechnen. */
.selftest[data-state='bad'] {
	border-color: var(--bad);
	background: linear-gradient(var(--bad-veil), transparent 70%), var(--bg-raised);
}

.selftest__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gap);
	flex-wrap: wrap;
	margin-bottom: 6px;
}

.selftest__head .panel__title {
	margin-bottom: 0;
}

.badge {
	flex: none;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 5px 10px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--bg-sunk);
	color: var(--text-3);
}

.badge[data-state='ok'] {
	border-color: rgb(53 192 122 / 0.5);
	background: var(--ok-veil);
	color: var(--ok);
}

.badge[data-state='bad'] {
	border-color: var(--bad);
	background: var(--bad-veil);
	color: #ff8f85;
}

.selftest__count {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 8px;
}

.selftest__count #selftest-count {
	font-size: 24px;
	font-weight: 700;
	color: var(--text);
}

.selftest__count-unit {
	color: var(--text-3);
	font-size: 14px;
}

.selftest__note {
	color: var(--text-2);
	font-size: 15px;
}

.selftest[data-state='bad'] .selftest__note {
	color: var(--text);
}

/* ==========================================================================
   5 — FORMULARE
   ========================================================================== */
.form {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
}

.field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.field__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--text-2);
	letter-spacing: 0.01em;
}

.field__req {
	font-weight: 400;
	color: var(--text-3);
	font-size: 12px;
}

.field__input {
	width: 100%;
	min-height: var(--tap);
	padding: 10px 12px;
	background: var(--bg-sunk);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	color: var(--text);
	/* 16px verhindert das Hineinzoomen von iOS beim Fokus. */
	font-size: 16px;
	font-family: inherit;
}

.field__input--mono {
	font-family: var(--mono);
	font-size: 14px;
}

.field__input::placeholder {
	color: var(--text-3);
	opacity: 1;
}

.field__input:focus {
	border-color: var(--accent);
	outline: none;
	box-shadow: 0 0 0 3px var(--accent-veil);
}

select.field__input {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
		linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 34px;
}

/* Drei schmale Felder nebeneinander: Nonce, Decks, Durchdringung. */
.field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
	gap: var(--gap);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gap);
	margin-top: 2px;
}

.btn {
	min-height: var(--tap);
	min-width: var(--tap);
	padding: 11px 18px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--bg-panel);
	color: var(--text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	flex: 1 1 auto;
}

.btn:hover:not(:disabled) {
	border-color: var(--accent);
}

.btn:active:not(:disabled) {
	transform: translateY(1px);
}

.btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.btn--primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--text-ink);
}

.btn--primary:hover:not(:disabled) {
	background: var(--accent-lit);
	border-color: var(--accent-lit);
}

.btn--quiet {
	background: transparent;
	color: var(--text-2);
}

/* Leiser und schmaler als der Hauptknopf, aber NICHT flacher: 44 px ist die
   Untergrenze fuer alles Bedienbare, sonst trifft der Daumen daneben. */
.btn--small {
	flex: 0 0 auto;
	min-height: var(--tap);
	padding: 7px 14px;
	font-size: 14px;
	font-weight: 500;
}

.status {
	margin-top: 12px;
	color: var(--text-2);
	font-size: 15px;
	background: var(--bg-sunk);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
}

.error {
	margin-top: 12px;
	color: #ff8f85;
	font-size: 15px;
	background: var(--bad-veil);
	border: 1px solid var(--bad);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
}

/* ==========================================================================
   6 — NACHWEISZEILEN
   ========================================================================== */
.result {
	margin-top: 16px;
	border-top: 1px solid var(--line-soft);
	padding-top: 16px;
}

.proof {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.proof-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line-soft);
	background: var(--bg-sunk);
}

.proof-row[data-ok='true'] {
	border-color: rgb(53 192 122 / 0.35);
}

.proof-row[data-ok='false'] {
	border-color: var(--bad);
	background: var(--bad-veil);
}

.proof-row[data-ok='unknown'] {
	border-color: var(--line);
}

.proof-mark {
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 700;
	background: var(--bg-panel);
	color: var(--text-3);
}

.proof-row[data-ok='true'] .proof-mark {
	background: var(--ok-veil);
	color: var(--ok);
}

.proof-row[data-ok='false'] .proof-mark {
	background: var(--bad);
	color: #fff;
}

.proof-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.proof-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--text);
}

.proof-detail {
	font-size: 13px;
	line-height: 1.45;
	color: var(--text-2);
	font-variant-numeric: tabular-nums;
	/* Hashes sind eine lange Kette ohne Trennstelle. */
	overflow-wrap: anywhere;
}

.result__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gap);
	flex-wrap: wrap;
	margin: 16px 0 10px;
}

.result__summary {
	font-size: 13px;
	color: var(--text-3);
	min-width: 0;
	overflow-wrap: anywhere;
	flex: 1 1 200px;
}

.result__legend {
	font-size: 13px;
	color: var(--text-3);
	margin-bottom: 10px;
}

/* ==========================================================================
   7 — KARTEN
   ========================================================================== */
.cards {
	display: grid;
	/* 5 Spalten auf 412 px, mehr auf breiteren Schirmen — ohne Medienabfrage. */
	grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
	gap: 6px;
	/* 416 Karten sind viel: der Block bekommt seinen eigenen Rollbereich,
	   damit die Erklaerung darunter erreichbar bleibt. */
	max-height: 60dvh;
	overflow-y: auto;
	padding: 10px;
	background: var(--felt);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-sm);
	overscroll-behavior: contain;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	aspect-ratio: 3 / 4;
	background: #f4f4f2;
	color: #17171d;
	border-radius: 5px;
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.45);
	font-variant-numeric: tabular-nums;
}

.card[data-suit='H'],
.card[data-suit='D'] {
	color: #c0392b;
}

.card-pos {
	font-size: 9px;
	line-height: 1;
	color: #6d6d78;
	letter-spacing: 0.02em;
}

.card-face {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.1;
}

/* Die vier Startkarten der Turnierhand tragen ihre Rolle sichtbar. */
.card[data-role] {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
	margin-bottom: 14px;
}

.card[data-role]::after {
	content: attr(data-role);
	position: absolute;
	top: calc(100% + 3px);
	left: 50%;
	transform: translateX(-50%);
	font-size: 9px;
	line-height: 1.1;
	white-space: nowrap;
	color: var(--accent-lit);
	font-weight: 600;
}

/* ==========================================================================
   8 — FLIESSTEXT
   ========================================================================== */
/* Der Erklaerteil ist zum Lesen da: etwas mehr Zeilenhoehe als der Rest. */
.prose {
	line-height: 1.6;
}

.prose__sub {
	font-size: 16px;
	margin: 22px 0 10px;
	color: var(--accent-lit);
	letter-spacing: 0.01em;
}

.prose__sub:first-of-type {
	margin-top: 4px;
}

.prose__p {
	color: var(--text-2);
	font-size: 15px;
	margin-bottom: 10px;
}

.steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.step {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.step__mark {
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--accent-veil);
	border: 1px solid var(--accent-deep);
	color: var(--accent-lit);
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.step__body {
	color: var(--text-2);
	font-size: 15px;
	min-width: 0;
}

.step__body strong {
	color: var(--text);
}

/* Einwand und Antwort als Paare — die Liste selbst braucht nur den Rhythmus. */
.attacks {
	display: flex;
	flex-direction: column;
}

.attacks__q {
	font-weight: 600;
	color: var(--text);
	font-size: 15px;
	margin-top: 14px;
}

.attacks__q:first-of-type {
	margin-top: 0;
}

.attacks__a {
	color: var(--text-2);
	font-size: 15px;
	margin-top: 4px;
	padding-left: 12px;
	border-left: 2px solid var(--line);
}

.spec {
	display: flex;
	flex-direction: column;
	gap: 10px;
	counter-reset: spec;
}

.spec__item {
	counter-increment: spec;
	position: relative;
	padding-left: 30px;
	color: var(--text-2);
	font-size: 15px;
}

.spec__item::before {
	content: counter(spec);
	position: absolute;
	left: 0;
	top: 1px;
	width: 21px;
	height: 21px;
	border-radius: 4px;
	display: grid;
	place-items: center;
	background: var(--bg-sunk);
	border: 1px solid var(--line);
	color: var(--text-3);
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.limits {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.limits__item {
	color: var(--text-2);
	font-size: 15px;
	padding-left: 12px;
	border-left: 2px solid var(--accent-deep);
}

.limits__item strong {
	color: var(--text);
}

/* ==========================================================================
   9 — FUSS
   ========================================================================== */
.foot {
	padding: 20px var(--pad) calc(20px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--line-soft);
	background: var(--bg-sunk);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.foot__line {
	font-size: 13px;
	color: var(--text-3);
}

.foot__line--quiet {
	color: var(--text-3);
	opacity: 0.85;
}

.foot__algo {
	display: inline-block;
	margin-top: 4px;
}

/* ==========================================================================
   10 — BREITE SCHIRME
   Ab hier ist Platz fuer eine ruhige Spalte; die Seite bleibt einspaltig,
   weil sie gelesen und nicht ueberflogen wird.
   ========================================================================== */
@media (min-width: 700px) {
	.wrap {
		max-width: 760px;
		margin: 0 auto;
		padding: 28px var(--pad) 32px;
		gap: 24px;
	}

	.intro__title {
		font-size: 34px;
	}

	.panel {
		padding: 22px;
	}

	.cards {
		grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
		max-height: 70dvh;
	}	.foot {
		padding-left: 28px;
		padding-right: 28px;
	}
}

/* Wer Bewegung reduziert haben will, bekommt sie nicht. */
@media (prefers-reduced-motion: reduce) {
	.btn:active:not(:disabled) {
		transform: none;
	}
}
