/* Bananario — Bedienrahmen der installierbaren Spiele-Apps (inc/app.php,
   js/app.js). Wird auf jeder Seite eines App-Spiels geladen; alles, was das
   Website-Layout verändern würde, steht deshalb unter body.app-modus. */

/* ============================================================
   Hinweis "als App aufs Handy" (nur Website, Muster sd-app-tipp)
   ============================================================ */

.app-tipp {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	max-width: 46rem;
	margin: 1.6rem auto;
	padding: 1rem 1.1rem;
	background: linear-gradient(135deg, var(--sand, #FCF6E4), #FFF9E6);
	border: 2px solid var(--banana, #FFCC29);
	border-radius: var(--radius, 18px);
}
.app-tipp-icon {
	flex: none;
	width: 72px;
	height: 72px;
	border-radius: 16px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
}
.app-tipp-text { min-width: 0; }
.app-tipp h2 {
	margin: 0 0 .35rem;
	font-size: clamp(1.05rem, 3.6vw, 1.3rem);
	color: var(--jungle-dark, #1B5E3C);
}
.app-tipp p { margin: 0 0 .6rem; line-height: 1.55; }
.app-tipp-wege { margin: 0; padding-left: 1.1rem; font-size: .92rem; line-height: 1.7; }
@media (max-width: 560px) {
	.app-tipp { flex-direction: column; align-items: center; text-align: center; }
	.app-tipp-wege { text-align: left; display: inline-block; }
}

/* ============================================================
   App-Modus: Grundgerüst
   ============================================================ */

/* Sicherheitsnetz gegen eingefügte Werbung (Begründung: spiele/sudoku/
   sudoku.css). Während eines belohnten Videos setzt js/app.js die Klasse
   app-ad-laeuft (das Sudoku seine eigene sd-ad-laeuft) — sonst wäre
   ausgerechnet das gewollte Video unsichtbar. */
body.app-modus:not(.app-ad-laeuft):not(.sd-ad-laeuft) ins.adsbygoogle,
body.app-modus:not(.app-ad-laeuft):not(.sd-ad-laeuft) .ad-wrap,
body.app-modus:not(.app-ad-laeuft):not(.sd-ad-laeuft) .ad-sidebar,
body.app-modus:not(.app-ad-laeuft):not(.sd-ad-laeuft) .ad-banner,
body.app-modus:not(.app-ad-laeuft):not(.sd-ad-laeuft) iframe[id^="aswift"],
body.app-modus:not(.app-ad-laeuft):not(.sd-ad-laeuft) iframe[id^="google_ads"],
body.app-modus .cookie-consent {
	display: none !important;
}

body.app-modus {
	overscroll-behavior: none;     /* kein Ziehen-zum-Neuladen */
	touch-action: manipulation;    /* kein Doppeltipp-Zoom */
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
}

/* Das Video-Fenster der Spiele (css/style.css, z-index 60) liegt außerhalb
   der Spielfläche — in der App ist die aber dauerhaft "Vollbild" (z-index
   9999) und würde es verdecken. */
body.app-modus .video-fenster { z-index: 10080; }

/* ============================================================
   Menüknopf
   ============================================================ */

/* Oben rechts — dort saß in Pinball/Puzzle/Bubble der Vollbild-Knopf, der
   in der App entfällt. Die Fläche ist in allen drei Spielen also schon als
   "hier liegt ein Knopf" erprobt und verdeckt nichts Spielwichtiges. */
.app-menue-knopf {
	position: fixed;
	top: calc(8px + env(safe-area-inset-top, 0px));
	right: calc(8px + env(safe-area-inset-right, 0px));
	z-index: 10060;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid rgba(255, 226, 150, .5);
	background: rgba(14, 20, 10, .62);
	color: #FFE9A8;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	touch-action: manipulation;
}
.app-menue-knopf:active { background: rgba(60, 90, 40, .8); }

/* ============================================================
   Blätter (Menü, Bestenliste, Anmeldung, Spiele, Ende)
   ============================================================ */

.app-blatt {
	position: fixed;
	inset: 0;
	z-index: 10100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	padding-top: calc(1rem + env(safe-area-inset-top, 0px));
	padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	background: rgba(8, 20, 12, .72);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	font-family: var(--font-body, system-ui, sans-serif);
}
.app-blatt[hidden] { display: none !important; }

.app-blatt-inhalt {
	position: relative;
	width: 100%;
	max-width: 32rem;
	margin: auto 0;               /* zentriert, lässt bei Überlänge den Anfang sichtbar */
	background: var(--sand, #FFF6DE);
	color: var(--ink, #2B2B20);
	border-radius: 18px;
	box-shadow: 0 18px 46px rgba(0, 0, 0, .42);
	padding: 1.2rem 1.2rem 1.1rem;
	box-sizing: border-box;
	text-align: left;
}
.app-blatt-schmal { max-width: 24rem; }
.app-blatt-inhalt h2 {
	margin: 0 2.2rem .7rem 0;
	font-family: var(--font-display, sans-serif);
	font-size: 1.35rem;
	color: var(--jungle-dark, #1F5E38);
}

.app-blatt-zu {
	position: absolute;
	top: .5rem;
	right: .55rem;
	width: 2.1rem;
	height: 2.1rem;
	border: 0;
	border-radius: 999px;
	background: rgba(0, 0, 0, .07);
	color: var(--ink, #333);
	font: inherit;
	font-size: 1.05rem;
	line-height: 1;
	cursor: pointer;
}
.app-blatt-zu:hover, .app-blatt-zu:focus-visible { background: rgba(0, 0, 0, .14); }

.app-blatt-weiter { display: block; width: 100%; margin-top: .9rem; }

/* Die display-Angabe von .btn schlägt [hidden] (bekannte Falle, siehe
   spiele/CLAUDE.md) */
.app-blatt .btn[hidden] { display: none; }

/* ---------- Menü ---------- */

.app-menue-konto { margin: -.2rem 0 .8rem; color: var(--ink-soft, #6B6A55); font-size: .92rem; }
.app-menue-liste { display: flex; flex-direction: column; gap: .5rem; }
.app-menue-eintrag {
	display: flex;
	align-items: center;
	gap: .7rem;
	width: 100%;
	padding: .8rem 1rem;
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 14px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-weight: 700;
	font-size: 1.02rem;
	text-align: left;
	cursor: pointer;
}
.app-menue-eintrag span { font-size: 1.3rem; }
.app-menue-eintrag:active { background: var(--banana, #FFD93B); }

/* ---------- Bestenliste ---------- */

.app-bl-tabs { display: flex; gap: .3rem; margin: .2rem 0 .8rem; }
.app-bl-tabs button {
	flex: 1;
	font: inherit;
	font-size: .82rem;
	padding: .45rem .3rem;
	border: 1px solid #e3d9bd;
	background: #fff;
	border-radius: .6rem;
	cursor: pointer;
}
.app-bl-tabs button.aktiv {
	background: var(--jungle, #2E7D46);
	border-color: var(--jungle, #2E7D46);
	color: #fff;
	font-weight: 700;
}
.app-bl-tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.app-bl-tabelle th,
.app-bl-tabelle td { padding: .32rem .4rem; border-bottom: 1px solid #e8e0c8; }
.app-bl-tabelle th { text-align: left; font-size: .76rem; color: var(--ink-soft, #6b6b5a); }
.app-bl-tabelle .num { text-align: right; font-variant-numeric: tabular-nums; }
.app-bl-tabelle tr.ich { background: #FFEFAE; font-weight: 700; }
.app-bl-leer { color: var(--ink-soft, #777); }
.app-bl-eigener { margin: .7rem 0 0; font-weight: 700; }
.app-bl-liste { max-height: 55vh; overflow-y: auto; }

/* ---------- Anmeldung ---------- */

.app-login-form label { display: block; margin-bottom: .6rem; }
.app-login-form label span { display: block; font-size: .8rem; margin-bottom: .2rem; color: var(--ink-soft, #666); }
.app-login-form input {
	width: 100%;
	font: inherit;
	font-size: 16px;              /* verhindert das Hineinzoomen auf iOS */
	padding: .6rem .7rem;
	border: 1px solid #ded3b4;
	border-radius: .6rem;
	box-sizing: border-box;
}
.app-login-form .btn { width: 100%; margin-top: .3rem; }
.app-login-form[hidden] { display: none; }
.app-login-fehler { color: #b3261e; font-size: .86rem; margin: .1rem 0 .5rem; }
.app-login-fuss { display: flex; justify-content: space-between; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.app-link {
	background: none;
	border: 0;
	padding: .3rem 0;
	color: var(--jungle-dark, #1F5E38);
	font: inherit;
	font-size: .9rem;
	text-decoration: underline;
	cursor: pointer;
}
.app-link[hidden] { display: none; }

/* ---------- Ende-Blatt ---------- */

.app-ende-zahl {
	margin: 0 0 .4rem;
	font-size: 2.4rem;
	font-weight: 800;
	line-height: 1.1;
	color: var(--jungle-dark, #1F5E38);
	font-variant-numeric: tabular-nums;
	text-align: center;
}
#appEndeText p { margin: 0 0 .5rem; line-height: 1.45; text-align: center; }
.app-ende-knoepfe { display: flex; flex-direction: column; gap: .5rem; margin-top: .9rem; }
.app-ende-knoepfe .btn { width: 100%; }

/* ---------- Spieleübersicht ---------- */

.app-spiele-inhalt { max-width: 34rem; }
.app-spiele-rubrik {
	margin: .9rem 0 .5rem;
	font-size: .78rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ink-soft, #6B6A55);
}
.app-spiele-apps {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .6rem;
}
.app-spiel-kachel {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .25rem;
	padding: .8rem .5rem .7rem;
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 16px;
	background: #fff;
	color: inherit;
	font: inherit;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	min-width: 0;
}
.app-spiel-kachel img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.app-spiel-kachel strong { font-size: .98rem; line-height: 1.2; }
.app-spiel-kachel span { font-size: .78rem; color: var(--ink-soft, #6B6A55); line-height: 1.3; }
.app-spiel-kachel:active { background: var(--banana, #FFD93B); }
.app-spiel-hier { opacity: .6; border-style: dashed; }

.app-spiele-hinweis { margin: .6rem 0 0; font-size: .82rem; color: var(--ink-soft, #6B6A55); line-height: 1.45; }

.app-spiele-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.app-spiele-liste a {
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .55rem .7rem;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	border: 1px solid rgba(0, 0, 0, .07);
}
.app-spiele-liste a:active { background: var(--banana, #FFD93B); }
.app-spiele-emoji { font-size: 1.5rem; width: 2rem; text-align: center; flex: none; }
.app-spiele-text { display: flex; flex-direction: column; min-width: 0; }
.app-spiele-text strong { font-size: .95rem; }
.app-spiele-text span { font-size: .78rem; color: var(--ink-soft, #6B6A55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
