/* Die Welt ist die Oberfläche: ein fester Spielrahmen, darüber nur HUD und Laden.
   Mobile zuerst. Die bestehende Gebäude-/Dialogoptik bleibt der Materialbaukasten. */
body.jupi.p2j_body {height:100dvh;min-height:0;overflow:hidden;padding:0;margin:0}
body.jupi.p2j_body .jupi_container {height:100%;width:100%;max-width:none;margin:0;padding:0;display:flex;flex-direction:column;min-height:0}
body.jupi.p2j_body .jupi_header.p2j_leiste {flex:none;min-height:52px;padding:4px 8px;gap:6px;grid-template-columns:auto 1fr auto;border-bottom-width:2px;box-shadow:0 2px 8px #0006}
body.jupi.p2j_body .p2j_marke {justify-self:center;gap:5px;grid-column:2;grid-row:1}
body.jupi.p2j_body .p2j_marke img {width:28px;height:28px;border-radius:7px}
body.jupi.p2j_body .p2j_marke h1 {font-size:14px}
body.jupi.p2j_body .p2j_marke small {display:none}
body.jupi.p2j_body .p2j_leiste .jupi_nav_back {min-width:40px;min-height:40px;max-width:80px;font-size:11px;padding:6px;white-space:normal;line-height:1.15}
body.jupi.p2j_body .p2j_leiste .jupi_werkzeuge {gap:4px;flex-wrap:nowrap;grid-column:3;grid-row:1}
body.jupi.p2j_body .p2j_leiste .jupi_sprachen_wahl {gap:0}
body.jupi.p2j_body .p2j_leiste .jupi_sprachen_select {width:48px;min-width:40px;max-width:48px;height:40px;padding:2px;font-size:11px}
body.jupi.p2j_body .p2j_leiste .jupi_theme_switch {width:54px;min-width:54px;height:40px}
body.jupi.p2j_body .jupi_main {flex:1 1 auto;min-height:0;width:100%;margin:0;padding:0;overflow:hidden}
body.jupi.p2j_body .p2j_start {height:100%;min-height:0;padding:12px;overflow-y:auto;justify-content:flex-start}
body.jupi.p2j_body .p2j_start_karte {margin:auto;flex:none;max-width:540px;padding:22px;width:100%;box-sizing:border-box}
body.jupi.p2j_body .p2j_start_logo {width:88px;height:88px}
body.jupi.p2j_body .p2j_spiel {position:relative;height:100%;min-height:0;width:100%;display:block;margin:0;padding:0;isolation:isolate;overflow:hidden}
body.jupi.p2j_body .p2j_stadtrahmen,body.jupi.p2j_body .p2j_stadtmitte {position:static;display:block;margin:0;padding:0;border:0;max-width:none}
body.jupi.p2j_body .p2j_stadtbuehne {position:absolute;inset:0;width:100%;height:100%;min-height:0;max-height:none;border:0;border-radius:0;box-shadow:none;margin:0;background:#6eaa46}
body.jupi.p2j_body .p2j_stadtbuehne::before,body.jupi.p2j_body .p2j_stadtbuehne::after {display:none}
body.jupi.p2j_body #p2j_dorf_canvas {width:100%;height:100%;display:block;aspect-ratio:auto;touch-action:none;border-radius:0}
body.jupi.p2j_body .p2j_kartenmarke,body.jupi.p2j_body .p2j_stadtkopf small,body.jupi.p2j_body .p2j_simulation,body.jupi.p2j_body .p2j_stadtstat,body.jupi.p2j_body .p2j_werbung,body.jupi.p2j_body #p2j_nav_stadt,body.jupi.p2j_body .p2j_meldungen {display:none}
body.jupi.p2j_body .p2j_stadtkopf {position:absolute;z-index:3;top:10px;left:10px;right:10px;height:40px;display:flex;justify-content:space-between;align-items:center;margin:0;padding:0;pointer-events:none}
body.jupi.p2j_body .p2j_stadtkopf h2 {font-size:16px;line-height:1.3;color:#fff8dc;text-shadow:0 2px 3px #19371c,0 0 6px #19371c;margin:0;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.jupi.p2j_body .p2j_stadtkopf button {pointer-events:auto;min-height:40px;padding:6px 12px;font-size:12px}
body.jupi.p2j_body .p2j_ressourcen {position:absolute;z-index:3;top:58px;left:8px;right:8px;display:flex;gap:0;justify-content:space-around;margin:0;padding:3px;border:1px solid #d8b466;border-radius:10px;background:#172b29e8;box-shadow:0 3px 8px #0005}
body.jupi.p2j_body .p2j_ressource {flex:1;min-width:0;padding:3px;display:flex;flex-wrap:wrap;justify-content:center;gap:3px;border:0;background:none;font-size:11px;color:#fff1cb;box-shadow:none}
body.jupi.p2j_body .p2j_ressource strong {font-size:12px;line-height:20px}
body.jupi.p2j_body .p2j_ressource small {display:block;flex-basis:100%;text-align:center;font-size:9px;line-height:12px;color:#d9e7cf}
body.jupi.p2j_body .p2j_ressource .p2j_symbol {width:18px;height:18px}
body.jupi.p2j_body #p2j_wert_macht {display:none}
body.jupi.p2j_body .p2j_wallet {position:absolute;z-index:3;top:113px;right:8px;display:grid;grid-template-columns:auto auto;gap:2px 8px;align-items:center;background:#172b29ed;color:#ffedc0;border:1px solid #d8b466;border-radius:9px;padding:6px 8px;box-shadow:0 3px 8px #0004;font-size:11px}
body.jupi.p2j_body .p2j_wallet strong {font-size:15px;font-variant-numeric:tabular-nums}
body.jupi.p2j_body #p2j_rundenende {grid-column:1/-1;min-height:40px;padding:4px 8px;font-size:12px}
body.jupi.p2j_body .p2j_seitenaktionen {position:absolute;z-index:3;top:113px;left:8px;display:grid;gap:8px;width:115px}
body.jupi.p2j_body .p2j_seitenaktionen button {font-size:11px;min-height:44px;padding:6px 8px;display:flex;align-items:center;justify-content:center;gap:4px}
body.jupi.p2j_body #p2j_sammeln {flex-wrap:wrap;background:linear-gradient(#fff3ad,#e6b546);color:#3f321b;border-color:#8d6323}
body.jupi.p2j_body #p2j_sammeln b {flex-basis:100%;font-variant-numeric:tabular-nums}
body.jupi.p2j_body .p2j_dock {position:absolute;z-index:5;bottom:max(10px,env(safe-area-inset-bottom));left:8px;right:8px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0 auto;max-width:580px}
body.jupi.p2j_body .p2j_dock button {min-width:0;height:64px;padding:6px 3px;font-size:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:12px;box-shadow:0 4px 0 #293327,0 5px 12px #0006}
body.jupi.p2j_body .p2j_dock .p2j_symbol {width:25px;height:25px}
body.jupi.p2j_body .p2j_angriff {background:linear-gradient(#f38145,#bd4427);border-color:#ffce82;color:white}
body.jupi.p2j_body .p2j_kamera {z-index:3;inset:auto 8px 86px auto;display:flex;gap:3px;background:#172b29cc;padding:4px;border-radius:9px}
body.jupi.p2j_body .p2j_kamera button {width:40px;height:40px;min-height:40px;min-width:40px;margin:0;font-size:19px}
body.jupi.p2j_body .p2j_buehne_info {z-index:3;inset:auto 8px 141px 8px;display:flex;flex-direction:column;align-items:center;gap:4px;padding:0;pointer-events:none}
body.jupi.p2j_body .p2j_buehne_tipp,body.jupi.p2j_body .p2j_bau_aktiv {font-size:11px;line-height:1.4;max-width:460px;padding:7px 10px;border:1px solid #d8b466;background:#172b29e8;color:#fff4d8;border-radius:8px;box-shadow:0 2px 6px #0004}
body.jupi.p2j_body #p2j_platzierung_abbrechen {pointer-events:auto;min-height:40px;font-size:12px;padding:6px 14px}
/* Die Werkzeuglade verdeckt nur beim Auswählen die untere Wiese. */
body.jupi.p2j_body .p2j_baukatalog {display:none;position:absolute;z-index:6;bottom:82px;left:8px;right:8px;max-width:740px;margin:0 auto;padding:10px;background:linear-gradient(#3d4b39,#23382c);border:2px solid #d3b270;border-radius:14px;box-shadow:0 6px 30px #0009}
body.jupi.p2j_body.p2j_bauen_offen .p2j_baukatalog {display:block}
body.jupi.p2j_body .p2j_baukopf {display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px;padding:0;border:0}
body.jupi.p2j_body .p2j_baukopf strong {color:#fff1ca;font-size:13px;flex:1;align-self:center}
body.jupi.p2j_body .p2j_lade_zu {float:right;min-height:40px;font-size:11px;padding:4px 8px;margin-bottom:6px}
body.jupi.p2j_body .p2j_baufilter {order:3;flex-basis:100%;display:flex;overflow:auto;gap:4px}
body.jupi.p2j_body .p2j_baufilter button {flex:1;min-width:40px;min-height:40px;padding:4px;font-size:11px}
body.jupi.p2j_body .p2j_baumenue {display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;max-height:180px;padding:2px 2px 10px;scroll-snap-type:x proximity}
body.jupi.p2j_body .p2j_bau_karte {flex:0 0 126px;min-height:148px;max-width:126px;scroll-snap-align:start;padding:7px;font-size:11px}
body.jupi.p2j_body .p2j_bau_karte canvas {width:90px;height:75px}
body.jupi.p2j_body .p2j_bau_karte strong {font-size:12px}
body.jupi.p2j_body .p2j_bau_karte span {font-size:10px}
body.jupi.p2j_body .p2j_kommando,body.jupi.p2j_body .p2j_leisten {display:none;position:absolute;z-index:7;left:8px;margin:0;padding:8px;width:220px;grid-template-columns:1fr;border:2px solid #d3b270;background:#20352ff5;border-radius:12px;box-shadow:0 4px 20px #0006}
body.jupi.p2j_body .p2j_leisten .p2j_knopf {grid-column:auto}
body.jupi.p2j_body.p2j_mehr_offen .p2j_kommando {display:grid;top:165px;gap:4px}
body.jupi.p2j_body.p2j_mehr_offen .p2j_leisten {display:grid;top:343px;gap:3px;max-height:calc(100% - 425px);overflow-y:auto}
body.jupi.p2j_body .p2j_kommando>small,body.jupi.p2j_body .p2j_leisten_zeichen,body.jupi.p2j_body .p2j_bilanz {display:none}
body.jupi.p2j_body .p2j_kommando .p2j_nav {min-height:44px;margin:0;font-size:12px;display:flex;gap:8px;justify-content:flex-start;padding:7px}
body.jupi.p2j_body .p2j_leisten .p2j_knopf {min-height:44px;font-size:12px;padding:7px;justify-content:flex-start}
/* Dialoge sind Teile des Spiels; auf dem Handy ein Blatt von unten. */
body.jupi.p2j_body .p2j_dialog {position:fixed;inset:auto 0 0;margin:0 auto;width:min(100%,800px);max-width:100%;max-height:85dvh;border-radius:18px 18px 0 0;border:2px solid #d3b270;box-sizing:border-box;overflow:hidden;padding:0}
body.jupi.p2j_body .p2j_dialog[open] {display:flex;flex-direction:column}
body.jupi.p2j_body .p2j_dialog_kopf {flex:none;padding:12px;min-height:58px;box-sizing:border-box}
body.jupi.p2j_body .p2j_dialog_kopf h2 {font-size:18px;min-width:0}
body.jupi.p2j_body .p2j_dialog_x {flex:none;min-width:44px;min-height:44px}
body.jupi.p2j_body .p2j_dialog_schau {padding:16px;overflow-y:auto;min-height:0;overscroll-behavior:contain;padding-bottom:max(18px,env(safe-area-inset-bottom))}
body.jupi.p2j_body .p2j_geb_panel {padding:16px;overflow-y:auto;min-height:0;overscroll-behavior:contain}
body.jupi.p2j_body #p2j_welt .p2j_buehne {flex:none;min-height:240px}
body.jupi.p2j_body #p2j_shop_raster {flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
body.jupi.p2j_body .p2j_shop_guthaben {flex:none;padding:8px 16px;margin:0;font-weight:800;background:#215541;color:#fff3cb;font-size:13px}
body.jupi.p2j_body .p2j_shop_fiktiv {flex:none;font-size:11px;padding:8px 12px;margin:0}
body.jupi.p2j_body .p2j_dialog_schau .p2j_knopf {margin:4px 3px 4px 0}
body.jupi.p2j_body .p2j_toast {position:fixed;z-index:1001;bottom:88px;left:12px;right:12px;top:auto;transform:none;max-width:560px;margin:auto;font-size:12px;pointer-events:none}
.p2j_match {text-align:center;padding:10px 0}.p2j_match img {width:68px;height:68px}.p2j_match h3 {font-size:23px;margin:8px 0}.p2j_match h4 {margin:10px 0}
.p2j_match_stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}.p2j_match_stats p {margin:0;padding:10px;border:1px solid var(--p2j_papier_rand);border-radius:9px}.p2j_match_stats strong {display:block;font-size:24px;font-variant-numeric:tabular-nums}
.p2j_sterne {font-size:40px;letter-spacing:10px;color:#c48619;text-shadow:0 2px #6c4b23}
.p2j_reflexion_fragen {padding:12px;border-left:4px solid #c48619;background:#a8861620}
body.jupi.p2j_body button:focus-visible {outline:3px solid #fff;outline-offset:2px}
html:fullscreen body.jupi.p2j_body .p2j_leiste {display:none}
@media(min-width:700px) {
 body.jupi.p2j_body .p2j_leiste .jupi_sprachen_select {width:120px;max-width:120px}
 body.jupi.p2j_body .p2j_leiste .jupi_nav_back {max-width:160px;font-size:13px}
 body.jupi.p2j_body .p2j_marke h1 {font-size:18px}
 body.jupi.p2j_body .p2j_ressourcen {left:auto;right:18px;top:14px;width:400px;padding:5px}
 body.jupi.p2j_body .p2j_stadtkopf {right:auto;left:18px;gap:20px}
 body.jupi.p2j_body .p2j_stadtkopf h2 {font-size:22px;max-width:240px}
 body.jupi.p2j_body .p2j_wallet {top:86px;right:18px}
 body.jupi.p2j_body .p2j_seitenaktionen {top:72px;left:18px;width:140px}
 body.jupi.p2j_body .p2j_seitenaktionen button {font-size:13px}
 body.jupi.p2j_body .p2j_dock {width:540px;left:50%;right:auto;transform:translateX(-50%)}
 body.jupi.p2j_body .p2j_dock button {height:72px;font-size:14px}
 body.jupi.p2j_body .p2j_kamera {right:18px;bottom:20px}
 body.jupi.p2j_body .p2j_buehne_info {bottom:112px}
 body.jupi.p2j_body .p2j_buehne_tipp {font-size:13px}
 body.jupi.p2j_body .p2j_baukatalog {bottom:96px}
 body.jupi.p2j_body .p2j_dialog {inset:0;margin:auto;max-height:85dvh;border-radius:16px;height:fit-content}
 body.jupi.p2j_body.p2j_mehr_offen .p2j_kommando {top:125px;left:18px}
 body.jupi.p2j_body.p2j_mehr_offen .p2j_leisten {top:303px;left:18px;max-height:calc(100% - 320px)}
}
@media(min-width:700px) and (max-width:1100px) and (min-height:531px) {
 body.jupi.p2j_body .p2j_kamera {bottom:96px}
 body.jupi.p2j_body .p2j_buehne_info {bottom:154px}
}
@media(max-height:530px) {
 body.jupi.p2j_body .p2j_wallet {top:58px;right:8px}
 body.jupi.p2j_body .p2j_ressourcen {top:4px;left:auto;width:55%;right:8px}
 body.jupi.p2j_body .p2j_seitenaktionen {top:58px}
 body.jupi.p2j_body .p2j_buehne_info {bottom:80px;left:170px;right:250px}
 body.jupi.p2j_body .p2j_kamera {bottom:84px}
 body.jupi.p2j_body .p2j_dock button {height:54px}
 body.jupi.p2j_body .p2j_baumenue {max-height:110px}.p2j_bau_karte canvas {display:none}
 body.jupi.p2j_body.p2j_mehr_offen .p2j_kommando {top:110px;width:180px}
 body.jupi.p2j_body.p2j_mehr_offen .p2j_leisten {top:110px;left:200px;width:180px;max-height:calc(100% - 180px)}
}
body.jupi.p2j_body [hidden] {display:none!important}
