/* Tarock — Spielseiten-Styles. Canvas intern fest 1060×720, responsiv per CSS
   skaliert; Klicks rechnet tarock.js über getBoundingClientRect() zurück
   (Muster Bisca/Schwimmen). Das Entscheidungsfeld #tkPanel liegt IM
   Vollbild-Rahmen über dem Tisch und geht deshalb automatisch mit ins
   Vollbild (Lehre aus der Vollbild-Runde 2026-08-15). */

.tk-wrap {
	max-width: 1060px;
	margin: 0 auto;
	position: relative;
	/* Bezugsgröße für die Schriften im Entscheidungsfeld: wächst mit dem Tisch */
	container-type: inline-size;
}

#tkCanvas {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 14px;
	box-shadow: 0 14px 36px rgba(45, 26, 8, 0.45);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	user-select: none;
}

.tk-fs-btn {
	position: absolute;
	bottom: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(240, 200, 110, 0.5);
	border-radius: 10px;
	background: rgba(46, 26, 8, 0.78);
	color: #ffe9b0;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	z-index: 3;
}
.tk-fs-btn:hover { background: rgba(80, 48, 16, 0.88); }

/* ---- Entscheidungsfeld über dem Tisch ---- */
.tk-panel {
	position: absolute;
	left: 50%;
	top: 47%;
	transform: translate(-50%, -50%);
	width: min(92%, 540px);
	max-height: 62%;
	overflow-y: auto;
	z-index: 2;
	background: rgba(38, 22, 6, 0.92);
	border: 1.5px solid rgba(240, 200, 110, 0.6);
	border-radius: 16px;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
	color: #ffe9b0;
	padding: clamp(10px, 1.8cqi, 18px) clamp(12px, 2.2cqi, 22px);
	text-align: center;
	font-size: clamp(12px, 1.5cqi, 16px);
}
.tk-panel[hidden] { display: none !important; }
.tk-panel-breit { width: min(94%, 680px); }
/* Talonwahl und Verlegen: Tisch und Hand müssen sichtbar bleiben */
.tk-panel-unten { top: auto; bottom: 25%; transform: translate(-50%, 0); max-height: 36%; }

/* Schmaler Tisch (Handy hochkant): Das Feld passt nicht über den Tisch und
   würde Knöpfe in einen inneren Scrollbereich drängen — dann steht es darunter.
   Im Vollbild-Querformat ist der Rahmen wieder breit genug für die Überlagerung. */
@container (max-width: 600px) {
	.tk-panel,
	.tk-panel-unten {
		position: static;
		transform: none;
		width: auto;
		max-height: none;
		margin-top: 0.6rem;
		font-size: 14px;
	}
	/* Der Rahmen ist jetzt höher als der Tisch: Den Vollbild-Knopf an die
	   Unterkante des Canvas hängen (Höhe = Breite × 720/1060), sonst landet
	   er im Entscheidungsfeld. */
	.tk-fs-btn {
		bottom: auto;
		top: calc(100cqi * 720 / 1060 - 46px);
		width: 36px;
		height: 36px;
	}
}

.tk-panel-titel {
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 1.35em;
	margin-bottom: 0.35em;
}
.tk-panel-text { color: #e9d9b0; line-height: 1.4; margin-bottom: 0.6em; }
.tk-panel-text p { margin: 0.3em 0; }
.tk-panel-knoepfe {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	justify-content: center;
}

.tk-knopf {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.1em;
	min-width: 7.5em;
	padding: 0.5em 0.9em;
	border: 1px solid rgba(240, 200, 110, 0.55);
	border-radius: 10px;
	background: #fdf3dc;
	color: #3a2606;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.tk-knopf:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.tk-knopf:disabled { opacity: 0.45; cursor: default; }
.tk-knopf:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
.tk-knopf-haupt { background: linear-gradient(#ffe38a, #f2c230); }
.tk-knopf-leise { background: rgba(253, 243, 220, 0.6); font-weight: 600; }
.tk-knopf-name { font-size: 1em; }
.tk-knopf-wert { font-size: 0.78em; font-weight: 500; opacity: 0.75; }

/* Ansagerunde (Stufe 2): Schalter für Ansagen und Kontra */
.tk-ansage-wahl {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	justify-content: center;
	margin: 0.6em 0 0.2em;
}
.tk-knopf-schalter { min-width: 0; background: rgba(253, 243, 220, 0.75); font-weight: 600; }
.tk-knopf-schalter.tk-an {
	background: linear-gradient(#ffe38a, #f2c230);
	box-shadow: inset 0 0 0 2px #8a5a00;
	font-weight: 800;
}

/* Abrechnung */
.tk-erg-kopf { font-weight: 600; color: #ffe9b0; }
.tk-erg-zeilen {
	list-style: none;
	margin: 0.4em auto;
	padding: 0;
	max-width: 26em;
	text-align: left;
}
.tk-erg-zeilen li {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding: 0.15em 0;
	border-bottom: 1px dashed rgba(240, 200, 110, 0.25);
}
.tk-erg-saldo { font-size: 0.9em; opacity: 0.85; }
.tk-erg-bananas { font-weight: 700; color: #ffd34d; }

/* ---- Vollbild ---- */
.tk-wrap:fullscreen,
.tk-wrap.tk-pseudo-fs {
	max-width: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #2a1806;
}
.tk-wrap.tk-pseudo-fs {
	position: fixed;
	inset: 0;
	z-index: 9999;
	margin: 0;
}
.tk-wrap:fullscreen #tkCanvas,
.tk-wrap.tk-pseudo-fs #tkCanvas {
	width: min(100%, calc(100vh * 1060 / 720));
	width: calc(min(100%, 100dvh * 1060 / 720) * var(--spiel-zoom, 1));
	height: auto;
	border-radius: 0;
}
body.tk-noscroll { overflow: hidden; }

.tk-status {
	text-align: center;
	min-height: 1.4em;
	margin-top: 0.8rem;
	color: var(--text-muted, #5c5344);
}

/* Spielarten-Tabelle in den Regeln */
.tk-tabelle { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1rem; }
.tk-tabelle th, .tk-tabelle td {
	text-align: left;
	padding: 0.4rem 0.5rem;
	border-bottom: 1px solid rgba(140, 100, 40, 0.2);
	vertical-align: top;
}
.tk-tabelle td:nth-child(2) { white-space: nowrap; font-weight: 700; }
