.spiel-link-row {
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    gap: 2px;
    justify-content: center;
    font-size: 14px;
}

/* Links im Titel (blauer Balken) sollen weiß sein */
h1 .spiel-link {
    color: #ffffff;
    text-decoration: underline;
    font-size: 0.6em;      /* etwas kleiner als der Titel */
    margin-left: 10px;
}

/* Hover leicht heller */
h1 .spiel-link:hover {
    color: #e0e0ff;
}


/* Container für die drei Aktionen unter dem Titel */
.spiel-actions {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Grundstil für Tipp / Video / Infos – gilt für <button> und <a> */
.spiel-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;              /* Pill-Form */
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    font-size: 0.5em;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, 
                color 0.2s ease,
                transform 0.1s ease,
                box-shadow 0.2s ease;
}

/* Button-spezifisches zurückdrehen */
.spiel-chip[type="button"],
button.spiel-chip {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.6);
}

/* Hover-Effekt: heller + leicht “heben” */
.spiel-chip:hover {
    background: #ffffff;
    color: #004080;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transform: translateY(-1px);
}

/* Fokus-Ring für Tastaturbedienung */
.spiel-chip:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}



/*Das ist die Box, in der die EINGABE über Tastatur oder Buttons beim Mathespielchen angezeigt wird.*/
.loesung-box {
  padding: 10px;
  border: 0px solid #ccc;
  border-radius: 8px;
  font-size: 24px;
  background-color: white;
  text-align: center;
  margin: 12px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
}


.eingabefeld-gruppe {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}



.eingabefeld-gruppe input {
  font-size: 18px;
  padding: 8px;
  margin: 5px;
  width: 120px; /* oder kleiner bei zwei Feldern */
  display: inline-block;
}

/* Das aktive Lösungsfeld ...*/
.loesung-anzeige {
  min-width: 100px;
  height: 40px;
  padding: 5px;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 22px;
  text-align: center;
  margin: 0.5em;
  line-height: 40px;
  background-color: white;
  user-select: none;
  position: relative;

/* neu: Flexbox, um Inhalt sowohl horizontal als auch vertikal zu zentrieren */
  display: flex;
  align-items: center;
  justify-content: center;

/* Schriftgröße etwas reduzieren */
  font-size: 14px;
  line-height: 1;      /* sorgt dafür, dass die Höhe wirklich 40px bleibt */
}


.loesung-anzeige .latex-placeholder {
  /* Platzhalter etwas dezenter und zentriert im Span */
  display: inline-block;
  font-size: inherit;  /* gleiche Größe wie Container */
  line-height: 1;
  padding: 0;
  margin: 0;
}


.loesung-anzeige:empty::before {
  content: attr(data-placeholder);
  color: #999;
  position: absolute;
  left: 0.5em;    /* je nachdem wie Dein innerText eingerückt ist */
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.loesung-anzeige.aktiv {
  border: 3px solid #1976d2;        /* schönes Blau */
  box-shadow: 0 0 8px #1976d2;
  background-color: #f0f8ff;        /* leicht bläulich */
}

.loesung-anzeige.richtig {
  border: 2px solid green;
  background-color: #e6ffe6;
}

.loesung-anzeige.falsch {
  border: 2px solid red;
  background-color: #ffe6e6;
}

.loesung-anzeige.teilweise {
  border: 2px solid orange;
  background-color: #fff8e1;
}

.loesung-hinweis {
  margin-left: 4px;
  color: green;
  font-size: 1.5em;
  font-weight: bold;
}

.var-label {
  font-weight: bold;
  margin-right: 0.25em;
}


/* Damit auch reine Text-Inhalte (keine Span) mittig bleiben */
.loesung-anzeige span,
.loesung-anzeige {
  text-align: center;
}

/* Der Container, in den die Seiten alle eingebettet werden */

.main-container {
	margin-top: 100px;
	width: 90%;
	margin-left: auto;
	margin-right: auto;
	overflow: hidden;
}

.qr-popup {
	display: none;
	position: fixed;
	background: rgba(255, 255, 255, 0.95);
	padding: 15px;
	border-radius: 8px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	text-align: center;
	width: 250px;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1000;
}

.qr-popup img {
	width: 100%;
	height: auto;
}

.qr-popup button {
	margin-top: 10px;
	padding: 5px 10px;
	border: none;
	background-color: #5a8bb5;
	color: white;
	cursor: pointer;
}

.qr-popup button:hover {
	background-color: #4a7ba5;
}

.links {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 30px;
	margin-bottom: 20px;
}

.links img {
	height: 100px;
	width: auto;
}


.links a {
    display: inline-block;
    margin: 10px;
    padding: 10px 20px;
    background: #004080;
    color: white;
    text-decoration: none;
    font-size: 18px;
    border-radius: 5px;
    transition: 0.3s;
}

.links a:hover {
		background: #336699;
	}

.youtube-btn {
	display: inline-block;
	background: #ff0000;
	color: white;
	padding: 10px 20px;
	border-radius: 5px;
	text-decoration: none;
	font-size: 18px;
	font-weight: bold;
	transition: 0.3s;
}

.youtube-btn:hover {
    background: #cc0000;
}
		

/* Box für Auftrag */
.hinweis-box {
    display: none;              /* wird nur bei Bedarf per JS eingeblendet */
    margin: 2px auto 6px auto;
	text-align: center;
}


/*calc fürs Handy*/
@media (max-width: 400px) {
.game-box {
		width: 95%;
	}
.div {
  font-size: 34px;
}
.links {
		flex-direction: column;
		gap: 10px;
	}
.button {
    font-size: 1.4rem;
    padding: 12px 18px;
    min-width: 50px;
  }

 #loesung {
    font-size: 2rem;
    width: 90%;
    padding: 12px;
    margin: 10px auto;
    display: block;
    text-align: center;
	margin-bottom: 3px;
  }

.game-container {
    width: 95%;
    margin: 0 auto;
}

button {
    font-size: 1.1rem;
    padding: 10px 14px;
  }
}

.filter-button {
	padding: 10px 20px;
	margin: 5px;
	border: none;
	border-radius: 20px;
	background-color: #cccccc;
	color: white;
	font-weight: bold;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.filter-button:hover {
	background-color: #999999;
}

.filter-button.active {
	background-color: #5a8bb5;
}


/* das Tastenfeld */

.tastenfeld-wrapper {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 2px auto;
  max-width: 400px;
}

.zahlenfeld {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 2px;
}

.checkfeld {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}

.button {
  width: 50px;
  height: 40px;
  font-size: 12px;
  display: flex;              /* neu */
  align-items: center;        /* vertikal zentriert */
  justify-content: center;    /* horizontal zentriert */
  text-align: center;
}

.double-button {
  width: 50px;
  height: 100px;
  font-size: 12px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.button-wide {
  width: 100px;  /* hier gewünschte Breite einstellen */
}

.untere-zeile {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.special {
  font-size: 14px;
  width: 80px;
}


/* Speed und andere Buttons*/
.schnell-reset {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: -5px;
    margin-bottom: 10px;
}

.speed-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.button.klein {
    font-size: 0.9rem;
    padding: 6px 10px;
    min-width: 80px;
}

/* Die Rückmeldungen ob etwas richtig oder falsch ist ...*/

.log-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 5px;
    font-size: 24px;
}

#log {
    color: red;
}
#log2 {
    color: green;
}


/* Die Überschrift, die man ausklappen kann als akkordeon*/

.category {
	background-color: #d0e0ff;
	font-weight: bold;
	text-align: center;
	padding: 15px;
	margin-top: 20px;
	cursor: pointer;
	user-select: none;
	border-radius: 6px;
	position: relative;
	margin-bottom: 10px;

}

.category::after {
	content: "▼";
	position: absolute;
	right: 20px;
	font-size: 16px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
}

.category.open::after {
	content: "▲";
}

/* Ein eÜberschrift, die nur eine Überschrift ist, wie das akkordeon Element aber ohne Ausklappen*/

.sortierung {
	background-color: #d0e0ff;
	font-weight: bold;
	text-align: center;
	padding: 15px;
	margin-top: 20px;
	margin-bottom: 10px;
	user-select: none;
	border-radius: 6px;
	position: relative;
	font-size: 18px;
	/* kein Pfeil, kein Klick */
}

/* Und wenn es etwas mehr Aufmerksamkein haben soll ....*/

.sortierung_new {
	position: relative;
	background-color: #d0e0ff;
	font-weight: bold;
	text-align: left;
	padding: 15px;
	margin-top: 20px;
	border-radius: 6px;
	margin-bottom: 10px;
	overflow: hidden;
	z-index: 1;
}

.sortierung_new h3 {
	margin: 0 0 10px;
	font-size: 20px;
}

.sortierung_new p {
	margin: 0;
	font-size: 14px;
	font-weight: normal;
}

/* Animierter Rahmen mit Gradient */
.sortierung_new::before {
	content: "";
	position: absolute;
	top: -2px;
	left: -2px;
	right: -2px;
	bottom: -2px;
	background: linear-gradient(45deg, #5a8bb5, #336699, #5a8bb5);
	z-index: -1;
	border-radius: 8px;
	background-size: 400% 400%;
	animation: borderGradientMove 4s ease infinite;
}

@keyframes borderGradientMove {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}








/* main */
html, body {
	touch-action: manipulation;
}

body {
	font-family: 'Montserrat', sans-serif;
	text-align: center;
	background-color: #ececec;
}

h1 {
	background: #004080;
	color: white;
	padding: 10px;
	border-radius: 10px;
	font-size: 22pt;
}

h2 {
	font-size: 18pt;
	font-weight: normal;
}


/* game-container für calc.php */
.game-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

/*Bei Übersichten genutzter Container, automatischer Zeilenumbruch*/
.link-container {
	background: white;
	padding: 20px;
	border-radius: 10px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	display: inline-block;
	margin-top: 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
}

.container {
	width: 90%;
	margin: auto;
	overflow: hidden;
}

.game-box {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	margin: 5px;
	border-radius: 6px;
	background-color: #f9f9f9;
}
		
.game-box a {
	display: inline-block;
	flex-grow: 1;
	text-align: center;
	padding: 8px;
	text-decoration: none;
	background: transparent;
	border-radius: 4px;
	transition: background 0.2s;
}
		
.game-box.ungespielt {
	background-color: #f0f0f0; /* Hellgrau für ungespielt */
	opacity: 0.9;
}


.button {
	font-size: 20px;
	padding: 10px;
	margin: 5px;
	border: none;
	border-radius: 5px;
	background-color: #004080;
	color: white;
	cursor: pointer;
}

.button:hover {
	background-color: #4a7ba5;
}

.output {
	font-size: 48px;
	margin: 20px 0;
	font-weight: bold;
	color: #444;
}

input {
	font-size: 24px;
	padding: 10px;
	text-align: center;
	border: 2px solid #5a8bb5;
	border-radius: 5px;
	width: 240px;
}


/* Felder bei calc.php*/
p1 {
	font-size: 24pt;
	color: red;
	padding: 0;
}

p2 {
	font-size: 24pt;
	color: green;
	padding: 0;
}

p3, table {
	font-size: 16pt;
	color: black;
}

.div {
	border-radius: 12px;
	visibility: visible;
	font-family: serif;
	font-style: bold;
	font-size: 42px;
	color: #000000;
	background-color: #dddddd;
}

.div2 {
	visibility: visible;
	font-family: serif;
	font-style: bold;
	font-size: 64px;
	color: #000000;
	background-color: #FFFFFF;
}

#idfehler {
	width: 350px;
	padding: 25px;
	border: none;
	border-radius: 12px;
	background: rgba(255, 200, 200, 0.95);
	color: #333;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
	text-align: center;
	font-size: 18px;
	animation: fadeIn 0.3s ease-in-out;
}

#infoDialog {
    width: 350px;
    padding: 25px;
    border: none;
    border-radius: 12px;
    background: rgba(210, 230, 255, 0.98);  /* helles Blau */
    color: #002244;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-size: 18px;
    animation: fadeIn 0.3s ease-in-out;
}


#loesung {
	min-height: 40px;
	display: inline-block;
	line-height: 1.5;
	font-size: 24px;
	background-color: white;
	border: 1px solid #ccc;
	padding: 10px;
}

#infoDialog::backdrop, #idfehler::backdrop {
background: rgba(0, 0, 0, 0.6);
}

#closeDialog {
background-color: #5a8bb5;
color: white;
border: none;
padding: 10px 15px;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
transition: background 0.2s ease-in-out;
}

#closeDialog:hover {
background-color: #4a7ba5;
}

@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}

/* Text Feld, in dem die Aufgaben kommen */
#text mjx-container {
  display: inline-block;
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

#text {
    min-width: 240px;     /* minimale Breite */
    max-width: 90vw;      /* nicht breiter als der Bildschirm */
    width: fit-content;   /* passt sich dem Inhalt an */
    height: 80px;        /* feste Höhe */
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid #aaa;
    margin: 4px auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Auftrag / Hinweis über der Aufgabe */
#hinweis {
    background-color: #e5e5e5;               /* sehr helles Blau */
    border-radius: 10px;                     /* wie andere Boxen */
    padding: 6px 18px;
    min-height: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 10px;

    font-size: 14px;                         /* gut lesbar */
    font-weight: 500;
    line-height: 1.3;

    border: 1px solid;              /* wie ein kleiner Button-Rahmen */
    box-shadow: 0 2px 4px rgba(0,0,0,0.08); /* ganz leicht, nicht so stark */
    text-align: center;
    max-width: 80vw;
}




/* Menü-Styling */
.navbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 20px;
	background: #004080;
	color: white;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
}

.navbar-left {
	display: flex;
	align-items: center;
}

.menu-btn {
	font-size: 28px; /* Größer für bessere Sichtbarkeit */
	background: #ffffff; /* Weißer Hintergrund für Kontrast */
	border: 2px solid #004080; /* Dunkelblauer Rand */
	color: #004080; /* Dunkelblau für Text */
	padding: 8px 12px; /* Größere Klickfläche */
	border-radius: 5px; /* Leicht abgerundete Ecken */
	cursor: pointer;
	transition: 0.3s;
}
.navbar-right {
	display: flex;
	align-items: center;
}

.username {
	margin-right: 15px;
	font-weight: bold;
}

.navbar-right a {
	color: white;
	text-decoration: none;
	margin-left: 10px;
}
 
/* Das Menü oben links, in dem alle Menüpunkte sind */

#menu {
	display: none;
	background: #f0f0f0;
	padding: 10px;
	position: fixed;
	left: 10px;
	top: 60px;
	width: 220px;
	box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	z-index: 9999;
/* Damit es auf Mobilgeräten scrollbar ist: */
	max-height: 90vh;
	overflow-y: auto;
}

/* Menü-Punkte */
#menu ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
}

#menu ul li {
	padding: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Letzter Menüpunkt ohne Rand */
#menu ul li:last-child {
	border-bottom: none;
}

/* Menü-Links */
#menu ul li a {
	color: #333; /* Dunkelgrau für besseren Kontrast */
	text-decoration: none;
	font-size: 16px;
	display: block;
}

/* Hover-Effekt */
#menu ul li:hover {
	background-color: #d0e0ff;
}

.header {
    background: #004080;
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}


        .news-item {
            background: #336699;
            color: white;
            padding: 15px;
            margin-bottom: 10px;
            border-radius: 5px;
        }

        .news-item h3 {
            margin: 0;
            font-size: 20px;
        }

        .news-item p {
            margin: 5px 0 0;
            font-size: 14px;
        }


/*Diagramme darstellen*/

.diagramm-box {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    margin: 10px auto;
    max-width: 800px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: none; /* wird erst bei Klick eingeblendet */
    transition: all 0.3s ease;
    display: none;
    background: white;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.diagramm-toggle {
    background-color: #d0e0ff;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.diagramm-toggle::after {
    content: "▼";
    position: absolute;
    right: 20px;
    font-size: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.diagramm-toggle.open::after {
    content: "▲";
}
