/* Spielsaal (multiplayer.php, js/spielsaal.js) — dunkle Lounge, Canvas-Spielfeld.
   Gestaltung nach der Vorlage des Users (2026-11-23): Kopfleiste mit Lampenlicht, Spielkarten
   mit ovalen Tischen, Seitenleiste als eigene Karte mit „Im Saal“, Chat und Satz-Knöpfen. */
.saal-seite { max-width: 1560px; margin: 0 auto; padding: 10px 10px 30px; }
.saal {
	--saal-gold: #f9d56b; --saal-gold-dunkel: #e3a628; --saal-dunkel: #120c08; --saal-text: #f3ead8; --saal-blass: #b9ab92;
	--saal-karte: #17110d; --saal-linie: rgba(255, 255, 255, .09);
	position: relative; display: flex; flex-direction: column;
	height: calc(100vh - 110px); min-height: 560px;
	background: var(--saal-dunkel); color: var(--saal-text);
	border-radius: 18px; overflow: hidden; box-shadow: 0 14px 44px rgba(0, 0, 0, .4);
	font-family: system-ui, "Segoe UI", sans-serif;
}
.saal:fullscreen, .saal.saal-pseudo-fs { height: 100vh; height: 100dvh; max-width: none; border-radius: 0; }
.saal.saal-pseudo-fs { position: fixed; inset: 0; z-index: 9000; }
.saal [hidden] { display: none !important; }

/* ---------- Kopfleiste ---------- */
.saal-leiste {
	position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 18px; z-index: 40;
	background:
		radial-gradient(ellipse 260px 90px at 46% -10px, rgba(255, 190, 110, .30), transparent 70%),
		radial-gradient(ellipse 200px 80px at 78% -10px, rgba(255, 190, 110, .18), transparent 70%),
		linear-gradient(180deg, #2a1b10, #160e09);
	border-bottom: 1px solid rgba(249, 213, 107, .22);
	box-shadow: 0 4px 18px rgba(0, 0, 0, .4);
}
.saal-logo { font-size: 2rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.saal-titel { font-family: var(--font-display, Pangolin, cursive); font-size: 1.8rem; color: var(--saal-gold); white-space: nowrap; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.saal-zahl {
	color: var(--saal-blass); font-size: .95rem; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .16);
}
.saal-leiste-knoepfe { display: flex; align-items: center; gap: 10px; }
.saal-knopf {
	position: relative; font: inherit; font-weight: 700; color: var(--saal-text); cursor: pointer;
	background: #2a1f17; border: 1px solid #574233; border-radius: 999px; padding: 7px 15px;
	transition: background .15s, transform .15s;
}
.saal-knopf:hover { background: #3a2a1c; }
.saal-knopf:disabled { opacity: .45; cursor: default; }
.saal-knopf-gold {
	background: linear-gradient(180deg, #ffe08a, var(--saal-gold-dunkel)); color: #2a1a08; border-color: #f7c848;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.saal-knopf-gold:hover { background: linear-gradient(180deg, #fff0b5, #f0b93a); transform: translateY(-1px); }
.saal-knopf-gross { font-size: 1.05rem; padding: 10px 22px; }
.saal-knopf-rot { background: #8e2f25; border-color: #b8493c; }
.saal-rund {
	position: relative; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	color: #f3ead8; background: radial-gradient(circle at 35% 30%, #3d2c20, #1d140e); border: 1px solid rgba(255, 255, 255, .14);
	box-shadow: 0 3px 10px rgba(0, 0, 0, .45); cursor: pointer; font-size: 1.2rem; padding: 0;
}
.saal-rund:hover, .saal-rund[aria-expanded="true"] { border-color: rgba(249, 213, 107, .7); color: var(--saal-gold); }
.saal-punkt { position: absolute; top: 4px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: #e2483b; box-shadow: 0 0 0 2px #1d140e; }
.saal-nur-mobil { display: none; }

/* Menüs unter Glocke und Zahnrad */
.saal-menue {
	position: absolute; top: calc(100% + 8px); right: 18px; z-index: 60; width: min(380px, calc(100% - 24px));
	background: #1d1510; border: 1px solid rgba(249, 213, 107, .45); border-radius: 16px; padding: 14px 16px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.saal-menue h3 { margin: 0 0 8px; font-size: 1rem; color: var(--saal-gold); }
.saal-einst { width: 260px; display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.saal-einst button, .saal-einst a {
	font: inherit; text-align: left; color: var(--saal-text); background: none; border: 0; border-radius: 10px;
	padding: 9px 12px; cursor: pointer; text-decoration: none;
}
.saal-einst button:hover, .saal-einst a:hover { background: rgba(255, 255, 255, .07); }
.saal-hinweis-liste { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.saal-hinweis-zeile { background: rgba(255, 255, 255, .04); border: 1px solid var(--saal-linie); border-radius: 12px; padding: 10px 12px; }
.saal-hinweis-zeile p { margin: 0; font-size: .93rem; line-height: 1.4; }
.saal-hinweis-zeile .saal-knoepfe { margin-top: 8px; }

/* ---------- Spielfeld und Seitenleiste ---------- */
.saal-mitte { position: relative; flex: 1 1 auto; display: flex; min-height: 0; background: #120b07; }
.saal-feld { position: relative; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-width: 0; }
.saal-feld canvas { display: block; width: 100%; touch-action: manipulation; }

.saal-seite-leiste {
	flex: 0 0 330px; display: flex; flex-direction: column; min-height: 0; gap: 4px;
	margin: 14px 14px 14px 0; padding: 14px 14px 12px;
	background: linear-gradient(180deg, #1c1410, #140e0a); border: 1px solid var(--saal-linie); border-radius: 18px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.saal-seite-leiste h2 {
	display: flex; align-items: center; gap: 8px; font-size: 1.1rem; color: var(--saal-gold); margin: 4px 0 6px;
	padding-bottom: 8px; border-bottom: 1px solid var(--saal-linie);
}
.saal-ico { font-size: 1.2rem; }
.saal-leute { list-style: none; margin: 0 0 8px; padding: 0; flex: 0 0 auto; min-height: 46px; max-height: 168px; overflow-y: auto; }
.saal-leute li { display: flex; align-items: center; gap: 10px; padding: 5px 2px; font-size: .97rem; }
.saal-leute img { width: 36px; height: 36px; border-radius: 50%; background: #3a2a1c; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.saal-online { width: 10px; height: 10px; border-radius: 50%; background: #35d06a; box-shadow: 0 0 6px rgba(53, 208, 106, .8); flex: 0 0 auto; }
.saal-leute-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saal-leute .wo { color: var(--saal-blass); font-size: .8rem; margin-left: auto; white-space: nowrap; }
.saal-chat {
	list-style: none; margin: 0; padding: 8px 10px; flex: 1 1 auto; overflow-y: auto; min-height: 90px;
	background: #0f0a07; border: 1px solid var(--saal-linie); border-radius: 14px; font-size: .95rem;
}
.saal-chat li { padding: 4px 8px; margin: 3px 0; border-radius: 10px; }
.saal-chat li.ich { background: rgba(249, 213, 107, .08); }
.saal-chat b { color: #e9e2d0; font-weight: 700; margin-right: 4px; }
.saal-chat .ich b { color: var(--saal-gold); }
.saal-chat .gross { font-size: 1.45rem; vertical-align: middle; }
.saal-floskeln { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; flex: 0 0 auto; }
.saal-floskeln button {
	flex: 1 1 auto; font: inherit; font-size: .84rem; color: var(--saal-text); cursor: pointer; padding: 7px 11px; border-radius: 999px;
	background: #2a2019; border: 1px solid #4a3a2d; white-space: nowrap;
}
.saal-floskeln button:hover { background: #3a2c20; border-color: rgba(249, 213, 107, .5); }
.saal-emojis { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; padding: 6px; background: #0f0a07; border: 1px solid var(--saal-linie); border-radius: 12px; }
.saal-emojis button { font-size: 1.4rem; background: none; border: 0; cursor: pointer; padding: 3px 4px; border-radius: 8px; }
.saal-emojis button:hover { background: rgba(255, 255, 255, .08); }
.saal-eingabe {
	flex: 0 0 auto;
	display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 8px;
	background: #0f0a07; border: 1px solid var(--saal-linie); border-radius: 999px;
}
.saal-eingabe-smiley { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #4a3a2d; background: #2a2019; font-size: 1.3rem; cursor: pointer; }
.saal-eingabe-smiley[aria-expanded="true"], .saal-eingabe-smiley:hover { border-color: rgba(249, 213, 107, .7); }
.saal-eingabe-hinweis { color: var(--saal-blass); font-size: .9rem; }

/* ---------- Eingebettetes Spiel ---------- */
.saal-spiel { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: #0d0907; }
.saal-spiel-leiste { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #160e09; border-bottom: 1px solid rgba(249, 213, 107, .22); font-weight: 700; }
.saal-spiel iframe { flex: 1 1 auto; width: 100%; border: 0; background: #0d0907; }

/* ---------- Dialoge, Meldungen, Begrüßung ---------- */
.saal-dialog, .saal-willkommen { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(8, 5, 3, .72); padding: 16px; }
.saal-willkommen { z-index: 70; }
.saal-blatt {
	width: min(560px, 100%); max-height: calc(100% - 20px); overflow-y: auto;
	background: linear-gradient(180deg, #2a1d13, #1d140e); border: 1px solid rgba(249, 213, 107, .6); border-radius: 18px; padding: 22px 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.saal-blatt h1, .saal-blatt h2 { font-family: var(--font-display, Pangolin, cursive); color: var(--saal-gold); margin: 0 0 10px; }
.saal-blatt h1 { font-size: 1.9rem; }
.saal-blatt h2 { font-size: 1.45rem; }
.saal-blatt h2.saal-gruss { font-size: 1.9rem; }
.saal-blatt p { color: var(--saal-text); }
.saal-blatt a { color: var(--saal-gold); }
.saal-klein { color: var(--saal-blass) !important; font-size: .9rem; }
.saal-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.saal-spiele-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0; }
.saal-spiele-wahl button {
	font: inherit; color: var(--saal-text); cursor: pointer; text-align: center;
	background: #2d2016; border: 2px solid #4a3828; border-radius: 14px; padding: 14px 8px;
}
.saal-spiele-wahl button.gewaehlt { border-color: var(--saal-gold); background: #3a2a1c; }
.saal-spiele-wahl .icon { display: block; font-size: 2rem; }
.saal-optionen fieldset { border: 0; padding: 0; margin: 10px 0; }
.saal-optionen legend { color: var(--saal-gold); font-weight: 700; margin-bottom: 4px; }
.saal-optionen label { display: inline-flex; align-items: center; gap: 4px; margin: 2px 12px 2px 0; cursor: pointer; }
.saal-ergebnis { width: 100%; border-collapse: collapse; margin: 8px 0; }
.saal-ergebnis td { padding: 6px 8px; border-bottom: 1px solid #3a2a1c; }
.saal-ergebnis .sieger td { color: var(--saal-gold); font-weight: 700; }
.saal-toast {
	position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; max-width: calc(100% - 30px);
	background: #24180f; border: 1px solid var(--saal-gold); border-radius: 12px; padding: 10px 16px; font-weight: 600;
}
.saal-toast.fehler { border-color: #e2483b; }

.saal-text { max-width: 860px; margin: 22px auto 0; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 760px) {
	.saal-seite { padding: 4px 0 20px; }
	.saal { border-radius: 0; height: calc(100vh - 70px); }
	.saal-leiste { gap: 8px; padding: 8px 10px; }
	.saal-logo { font-size: 1.5rem; }
	.saal-titel { font-size: 1.35rem; }
	.saal-zahl, .saal-lang { display: none; }
	.saal-leiste-knoepfe { margin-left: auto; gap: 6px; }
	.saal-knopf-gross { font-size: .95rem; padding: 8px 14px; }
	.saal-rund { width: 38px; height: 38px; }
	.saal-nur-mobil { display: inline-flex; }
	.saal-seite-leiste {
		position: absolute; inset: 0 0 0 auto; width: min(330px, 90%); z-index: 20; margin: 0; border-radius: 18px 0 0 18px;
		box-shadow: -10px 0 30px rgba(0, 0, 0, .5); display: none;
	}
	.saal-seite-leiste.offen { display: flex; }
}
@media (min-width: 761px) {
	.saal-seite-leiste.zu { display: none; }
}
