:root {
  color-scheme: dark;
  --ink: #eaf1ff;
  --muted: #aebcd6;
  --surface: #202e51;
  --accent: #fff17c;
  --hot: #ff718f;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -20%, #314c81 0%, #1a294e 43%, #111c35 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #fff17c; outline-offset: 4px; }
.app { max-width: 1100px; margin: 0 auto; padding: 25px 24px 45px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 53px; height: 53px; background: var(--hot); color: #233150; transform: rotate(-9deg); border-radius: 15px; font-size: 37px; font-weight: 900; box-shadow: 0 8px 0 #14213b; }
.brand-name { font-size: 30px; font-weight: 950; letter-spacing: -.075em; line-height: .95; }
.brand-name span { color: #ff8ea4; }
.brand-subtitle { color: #aabbdf; letter-spacing: .19em; font-size: 9px; font-weight: 800; margin-top: 7px; }
.header-right { display: flex; align-items: center; gap: 14px; }
.version { font-size: 11px; letter-spacing: .17em; color: #a9b8d4; font-weight: 750; }
.version strong { color: #e7ebf7; }
.utility-button, .icon-button { border: 1px solid #52648c; color: #eaf1ff; background: #26395e; border-radius: 12px; }
.utility-button { padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; }
.utility-button:hover, .icon-button:hover { background: #3b5484; }
.game-frame { overflow: hidden; border: 5px solid #f4f0d8; background: #e7f5ff; border-radius: 23px; box-shadow: 0 22px 0 rgba(7,15,32,.32),0 31px 60px rgba(7,14,32,.35); }
.game-topbar { display: flex; align-items: center; gap: 20px; padding: 11px 16px; background: #faf7e7; color: #233c60; min-height: 55px; }
.stat { display: flex; gap: 9px; align-items: center; min-width: 87px; font-size: 14px; font-weight: 850; font-variant-numeric: tabular-nums; }
.stat-icon { color: #f6ad34; font-size: 24px; text-shadow: 0 1px #b66a32; }
.time-icon { font-size: 23px; font-weight: 850; }
.progress-track { flex: 1; height: 11px; border: 2px solid #c5d1dc; border-radius: 999px; overflow: hidden; background: #e9f0f6; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#66c9a2,#8acde4); border-radius: 999px; transition: width .12s; }
.icon-button { height: 31px; width: 36px; background: #ecf1f4; color: #203b5b; border-color: #c4cfdd; font-weight: 900; }
.icon-button:hover { background: #dbe6f3; }
.canvas-wrap { position: relative; overflow: hidden; background: #dff4ff; }
canvas { width: 100%; height: auto; aspect-ratio: 16/9; display: block; touch-action: none; }
.screen-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(19, 40, 67, .42); backdrop-filter: blur(3px); padding: 20px; z-index: 4; }
.screen-overlay.hidden { display: none; }
.modal { width: min(490px, 95%); text-align: center; background: #fffef6; color: #223955; border: 4px solid #253e61; border-radius: 27px; padding: 25px 32px 26px; box-shadow: 0 11px 0 #203650,0 22px 35px #1c335177; transform: rotate(-1deg); }
.modal-eyebrow { text-transform: uppercase; color: #e16c82; font-size: 11px; font-weight: 900; letter-spacing: .2em; }
.modal-icon { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 19px; margin: 11px auto 6px; background: #ffe78d; color: #d88542; font-size: 31px; transform: rotate(12deg); }
.modal h1 { font-size: clamp(23px,3.7vw,40px); font-weight: 950; letter-spacing: -.06em; margin: 9px 0; line-height: 1.05; }
.modal h1 em { color: #f26886; font-style: normal; }
.modal p { color: #5c6c80; font-size: 14px; line-height: 1.55; margin: 12px auto 18px; max-width: 390px; }
.control-hint { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 16px 0 21px; font-size: 12px; font-weight: 750; }
.control-hint[hidden] { display: none; }
.control-hint span { display: flex; align-items: center; gap: 5px; }
kbd { background: #e7edf2; border: 1px solid #b8c6d7; border-bottom-width: 3px; padding: 4px 7px; border-radius: 6px; font: inherit; }
.primary-button { width: 100%; max-width: 300px; padding: 13px 19px; border: 0; border-radius: 12px; color: #1e384b; background: #a9e9ae; box-shadow: 0 5px 0 #57a978; font-weight: 900; letter-spacing: .02em; font-size: 15px; }
.primary-button:hover { background: #b9f3bd; transform: translateY(-1px); }
.primary-button:active { box-shadow: 0 2px 0 #57a978; transform: translateY(3px); }
.primary-button span { margin-left: 15px; }
.toast { position: absolute; left: 50%; top: 70px; transform: translate(-50%,-12px); opacity: 0; background: #223c5be9; color: white; border: 2px solid #ffffffe8; box-shadow: 0 5px 0 #19314e55; padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 850; pointer-events: none; transition: .22s; white-space: nowrap; z-index: 3; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.game-footer { margin: 16px 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: #b8c9e3; }
.level-label { display: flex; gap: 10px; align-items: center; }
.level-label strong { color: #eff4ff; letter-spacing: .08em; }
.level-dot { background: #a5e7a2; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 4px #a5e7a228; }
.small-help span { margin: 0 7px; color: #6d83a5; }
.touch-control-panel { display: flex; justify-content: space-between; gap: 20px; margin: 16px auto 18px; max-width: 550px; -webkit-user-select: none; user-select: none; touch-action: none; }
.touch-group { display: flex; gap: 11px; }
.touch-button { min-width: 77px; height: 57px; border-radius: 13px; border: 2px solid #7086a9; background: #2b4169; color: #f0f5ff; box-shadow: 0 5px 0 #101d37; font-size: 26px; font-weight: 900; touch-action: none; }
.touch-button:hover { background: #405b87; }
.touch-button.pressed, .touch-button:active { background: #567ca6; transform: translateY(4px); box-shadow: 0 1px 0 #101d37; }
.jump-button { background: #ee768f; border-color: #f7a5b4; color: #172943; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; }
.jump-button:hover { background: #ff8aa0; }
.jump-button span { font-size: 12px; font-weight: 950; letter-spacing: .05em; }
.below-game { margin-top: 30px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.below-game > div { display: flex; align-items: flex-start; gap: 12px; padding: 17px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); border-radius: 15px; }
.below-icon { display: grid; place-items: center; width: 33px; height: 33px; flex-shrink: 0; background: #2d446b; border-radius: 9px; color: #ffe88c; font-size: 20px; font-weight: 900; }
.below-game strong { font-size: 12px; line-height: 1.35; }
.below-game p { color: #a9bada; font-size: 11px; line-height: 1.5; margin: 5px 0 0; }
@media (max-width: 700px) {
  .app { padding: 14px 10px 30px; }
  .header { margin-bottom: 13px; }
  .brand-mark { width: 40px; height: 40px; font-size: 27px; border-radius: 10px; }
  .brand-name { font-size: 24px; }
  .brand-subtitle { font-size: 7px; }
  .version { display: none; }
  .game-frame { border-width: 3px; border-radius: 15px; }
  .game-topbar { gap: 8px; padding: 7px 9px; min-height: 40px; }
  .stat { font-size: 11px; min-width: 58px; gap: 4px; }
  .stat-icon, .time-icon { font-size: 17px; }
  .modal { padding: 11px 15px 15px; border-width: 3px; border-radius: 17px; }
  .modal-icon { display: none; }
  .modal-eyebrow { font-size: 9px; }
  .modal h1 { font-size: 23px; margin: 5px 0; }
  .modal p { font-size: 11px; margin: 6px 0; line-height: 1.35; }
  .control-hint { font-size: 10px; margin: 7px 0 10px; gap: 7px; }
  kbd { padding: 2px 4px; }
  .primary-button { padding: 9px 11px; font-size: 12px; }
  .below-game { grid-template-columns: 1fr; }
  .game-footer { font-size: 11px; }
  .small-help { display: none; }
}
@media (max-width: 420px) {
  .modal { max-width: 95%; }
  .modal p { display: none; }
  .control-hint { margin: 6px 0; }
  .modal h1 { font-size: 18px; }
  .game-topbar .progress-track { display:none; }
  .touch-button { min-width: 65px; }
}

/* Prototyp 02: eigener Foto-Sprite – Upload bleibt auch während des Spiels erreichbar. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
.modal { max-height: calc(100% - 4px); overflow-y: auto; overscroll-behavior: contain; }
.modal-character { display: flex; gap: 13px; align-items: center; text-align: left; margin: 14px 0 10px; padding: 10px; border-radius: 14px; background: #edf4f4; border: 1px solid #c8d9e4; }
.sprite-preview { position: relative; display: grid; place-items: center; flex: 0 0 80px; width: 80px; height: 80px; overflow: hidden; background: linear-gradient(160deg,#3c5582,#202e51); border: 2px solid #657eaf; border-radius: 13px; }
.sprite-preview img { width: 100%; height: 100%; object-fit: contain; }
.sprite-placeholder { color: #ffe78d; font-size: 38px; font-weight: 900; }
.sprite-preview-light { flex-basis: 64px; width: 64px; height: 64px; background: linear-gradient(160deg,#cdeef1,#bce3d0); border-color: #a4becb; }
.sprite-preview-light .sprite-placeholder { color: #e58a9a; }
.modal-character-details { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.modal-character-details strong { color: #24415a; font-size: 13px; }
.modal-character-details > span { color: #637587; font-size: 11px; overflow-wrap: anywhere; }
.modal-character-actions { display: flex; gap: 9px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.file-button { border: none; color: #1f304f; background: #ffe78d; padding: 9px 14px; border-radius: 9px; font-weight: 850; font-size: 12px; }
.file-button:hover { background: #fff1b1; }
.file-button-dark { color: #fff; background: #304d78; padding: 8px 13px; }
.file-button-dark:hover { background: #44618b; }
.text-button { padding: 7px 2px; border: none; background: transparent; color: #416580; text-decoration: underline; font-size: 11px; font-weight: 750; }
.character-panel { display: flex; gap: 15px; align-items: center; margin: 20px 4px 0; padding: 15px; background: linear-gradient(110deg,#263b67,#283e66 80%); border: 1px solid #57709c; border-radius: 17px; }
.character-panel-info { flex: 1; min-width: 0; }
.character-panel-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 12px; }
.character-label { color: #ffdf89; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.character-panel h2 { font-size: 17px; margin: 0; }
.character-panel p { margin: 5px 0 10px; color: #cad8ee; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.character-panel-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.secondary-button { padding: 8px 12px; color: #e7f1ff; background: #334d78; border: 1px solid #7890b4; border-radius: 9px; font-weight: 800; font-size: 12px; }
.secondary-button:hover { background: #45638b; }
.zoom-control { display: flex; align-items: center; gap: 8px; color: #cad8ee; font-size: 11px; font-weight: 700; }
.zoom-control input { width: 95px; accent-color: #ffe78d; }
.zoom-control output { width: 41px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .modal-character { gap: 8px; margin: 6px 0; padding: 6px; }
  .sprite-preview-light { flex-basis: 45px; width: 45px; height: 45px; }
  .modal-character-details strong { font-size: 11px; }
  .modal-character-details > span { font-size: 9px; }
  .modal-character-actions { gap: 7px; margin-top: 1px; }
  .file-button-dark { padding: 6px 8px; font-size: 10px; }
  .text-button { padding: 4px 0; font-size: 9px; }
  .character-panel { align-items: flex-start; margin-top: 15px; padding: 12px; gap: 10px; }
  .sprite-preview { flex-basis: 60px; width: 60px; height: 60px; }
  .sprite-preview-light { flex-basis: 45px; width: 45px; height: 45px; }
  .character-panel h2 { font-size: 14px; }
}
/* Das Startmenü muss auch in einem schmalen Mobil-Viewport startbar sein. */
@media (max-width: 420px) {
  .modal { padding: 7px 10px 8px; }
  .modal-eyebrow { display: none; }
  .modal .control-hint { display: none; }
  .modal h1 { font-size: 17px; margin: 2px 0 4px; }
  .modal-character { margin: 4px 0 8px; padding: 5px; }
  .modal .primary-button { padding: 8px 10px; }
}


/* Prototyp 03: mehrere Pose-Bilder */
.character-panel-stacked { display: block; }
.character-panel-hero { display: flex; gap: 15px; align-items: center; margin-bottom: 16px; }
.pose-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pose-card { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); border: 1px solid #5b77a6; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pose-card-header { display: flex; align-items: flex-start; gap: 10px; }
.pose-card-header h3 { margin: 0; font-size: 15px; color: #f4f7ff; }
.pose-card-header p { margin: 1px 0 0; font-size: 11px; color: #bfd0eb; }
.pose-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: #ffe78d; color: #233150; font-size: 12px; font-weight: 900; flex: 0 0 auto; }
.pose-preview-wrap { display: flex; justify-content: center; }
.pose-preview { width: 100%; max-width: 112px; height: 112px; margin: 0 auto; }
.pose-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pose-meta strong { font-size: 12px; color: #fff7cf; overflow-wrap: anywhere; }
.pose-meta span { font-size: 11px; color: #bfd0eb; line-height: 1.35; }
.pose-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.pose-actions .file-button, .pose-actions .secondary-button { padding: 8px 11px; font-size: 11px; }
#modalPoseSummary { display: block; }
@media (max-width: 900px) {
  .pose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .character-panel-hero { align-items: flex-start; gap: 10px; }
  .pose-grid { gap: 10px; }
  .pose-preview { max-width: 92px; height: 92px; }
}
@media (max-width: 520px) {
  .character-panel-hero { display: block; }
  .character-panel-hero .sprite-preview { margin-bottom: 10px; }
  .pose-grid { grid-template-columns: 1fr; }
}

/* Prototyp 04: Platz für den zweiten Lauf-Frame. */
@media (min-width: 901px) {
  .pose-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Prototyp 06 – eingebettete Bild-Posen als eigenständige HTML-Datei exportieren. */
.export-panel { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:16px; padding:15px; border-radius:14px; border:1px solid #7090bb; background:#182b51; }
.export-panel-copy { flex:1; min-width:0; }
.export-panel h3 { font-size:16px; margin:0 0 5px; color:#fff3b4; }
.export-panel p { margin:0 0 6px; font-size:12px; line-height:1.5; color:#d2def2; }
.export-panel .export-status { margin:0; color:#9ccfbd; }
.export-panel .export-status.error { color:#ff9eaa; }
.export-button { background:#ffdb72; color:#1c3552; border:0; border-radius:11px; padding:13px 16px; min-width:190px; font-size:13px; font-weight:850; }
.export-button:hover { background:#ffefaa; }
.export-button:disabled { opacity:.6; cursor:progress; }
@media(max-width:600px) { .export-panel { flex-direction:column; align-items:stretch; } .export-button { width:100%; } }

/* Prototyp 07 – Leveldaten-Import (noch kein grafischer Editor). */
.level-load-panel { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; border:1px solid #5777a9; background:#1b3154; padding:16px; border-radius:14px; margin-top:18px; }
.level-load-panel h3 { margin:0 0 5px; font-size:16px; }
.level-load-panel p { margin:3px 0; }
.level-load-panel code { color:#ffe78d; }
#levelStatus { color:#b8eadb; }


/* Prototyp 08: Kindgerechter visueller Level-Baukasten */
.editor-toolbar { margin: 0 0 17px; background: #20365b; border:1px solid #5c7eac; border-radius:18px; padding:15px 17px; box-shadow:0 8px 18px #0b183b33; }
.editor-topline { display:flex; justify-content:space-between; gap:14px; align-items:center; }
.editor-eyebrow { font-size:10px; font-weight:900; letter-spacing:.15em; color:#ffdf92; }
.editor-intro h2 { margin:2px 0 3px; font-size:21px; line-height:1.2; }
.editor-intro p { margin:0; color:#b9cbe7; font-size:12px; }
.editor-main-actions { display:flex; gap:10px; flex-shrink:0; }
.editor-primary, .editor-play { border:0; border-radius:11px; padding:13px 18px; font-size:13px; font-weight:900; color:#233b58; background:#ffe087; }
.editor-primary:hover { background:#fff0b0; }
.editor-primary.is-editing { background:#b4f0c8; }
.editor-play { background:#b4f0c8; }
.editor-play:hover { background:#d1ffdb; }
.editor-tools { border-top:1px solid #506b94; margin-top:14px; padding-top:14px; display:flex; flex-direction:column; gap:11px; }
.editor-toolset { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.editor-tool, .editor-small-btn { border:1px solid #7892b8; background:#314e79; color:#eaf4ff; border-radius:9px; padding:9px 12px; font-size:12px; font-weight:800; }
.editor-tool:hover:not(:disabled), .editor-small-btn:hover:not(:disabled) { background:#43628d; }
.editor-tool.active, .editor-tool[aria-pressed="true"] { background:#ffe48a; color:#1b344d; border-color:#ffe48a; }
.editor-tool:disabled { opacity:.42; cursor:not-allowed; }
.editor-secondary-actions { border-top:1px solid #405a7f; padding-top:10px; }
.editor-grid-label { display:flex; align-items:center; gap:5px; font-size:12px; font-weight:750; margin-right:8px; color:#d9e7f8; cursor:pointer; }
.editor-grid-label input { accent-color:#ffe48a; }
.editor-panline { display:flex; align-items:center; gap:9px; color:#d2def2; font-size:12px; font-weight:750; }
.editor-panline input[type=range] { flex:1; min-width:80px; accent-color:#ffdf8b; }
.editor-panline #editorCameraLabel { min-width:95px; text-align:right; font-variant-numeric:tabular-nums; }
.editor-small-btn { padding:6px 10px; }
.editor-hint { color:#ffebb5; font-size:12px; margin:0; min-height:1.4em; line-height:1.45; }
.editor-inspector { display:grid; grid-template-columns: 1fr 1.5fr; gap:15px; padding:17px; margin: 13px 4px 19px; border:1px solid #6e8aad; border-radius:16px; background:#223a61; }
.editor-inspector h3 { margin:0 0 12px; font-size:16px; }
.editor-level-settings { border-right:1px solid #516b92; padding-right:16px; }
.editor-level-settings label, .editor-fields label { display:flex; flex-direction:column; gap:5px; font-size:11px; font-weight:800; color:#d5e3f7; }
.editor-level-settings label { margin:0 0 10px; }
.editor-level-settings input, .editor-fields input:not([type=checkbox]), .editor-fields select { width:100%; min-width:0; padding:8px 9px; border-radius:8px; color:#233955; border:2px solid #aabed5; background:#f7fbff; font:inherit; font-size:13px; }
.editor-level-settings p { font-size:11px; color:#aebfda; line-height:1.5; margin:10px 0 0; }
.editor-level-settings code { color:#ffe494; }
.editor-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.editor-fields .editor-checkbox { flex-direction:row; align-items:center; justify-content:flex-start; margin-top:16px; }
#editorSelectionEmpty { color:#bdcce3; font-size:12px; line-height:1.5; }
.editor-object-actions { margin-top:13px; display:flex; gap:9px; flex-wrap:wrap; }
.editor-danger { border:1px solid #ff96ae; background:#77384f; color:#fff; border-radius:9px; padding:9px 13px; font-size:12px; font-weight:800; }
.editor-danger:hover { background:#97435c; }
.game-frame.editor-active { outline:4px solid #ffdf8b; outline-offset:2px; }
.game-frame.editor-active canvas { cursor:crosshair; }
@media (max-width: 750px) {
 .editor-topline { flex-direction:column; align-items:stretch; }
 .editor-main-actions { flex-wrap:wrap; }
 .editor-inspector { grid-template-columns:1fr; }
 .editor-level-settings { border-right:0; border-bottom:1px solid #516b92; padding-right:0; padding-bottom:12px; }
 .editor-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .editor-panline #editorCameraLabel { min-width:70px; font-size:10px; }
}

/* Prototyp 11 – Hintergrundtexte und einheitliche Figurgröße */
.editor-scale-label { margin-top:14px !important; }
.editor-scale-control { display:flex;gap:12px;align-items:center; }
.editor-scale-control input { flex:1;min-width:90px;accent-color:#ffe48a; }
.editor-scale-control output { min-width:44px;white-space:nowrap;font-variant-numeric:tabular-nums;text-align:right;color:#ffe8a6; }
#editorTextWrap { grid-column:span 2; }
.editor-fields input[type=color] { width:100%;height:38px;min-width:0;background:#f7fbff;border:2px solid #aabed5;border-radius:8px;padding:3px;cursor:pointer; }
.character-panel .zoom-control { padding:6px 10px;background:#172a4d;border-radius:9px; }
@media(max-width:580px) { #editorTextWrap { grid-column:span 2; } }

/* Prototyp 12: Levelverwaltung für komplette Spiele */
.level-manager { margin: 0 0 18px; background: linear-gradient(135deg,#304975,#223b66); border: 1px solid #6b86af; padding: 17px 20px 14px; border-radius: 18px; box-shadow: 0 8px 17px #0d193633; }
.level-manager-top { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.level-manager h2 { margin:5px 0 0; font-size:20px; }
.game-name-field { display:flex; align-items:center; gap:10px; font-size:12px; font-weight:700; color:#d8e3f5; }
.game-name-field input { min-width:180px; max-width:100%; width:250px; background:#f7f9ff; color:#263854; padding:8px 10px; border-radius:9px; border:1px solid #91a1bc; font:inherit; }
.level-tabs-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:16px; margin-bottom:8px; font-size:12px; }
.level-tabs-head span { color:#b9cde8; }
.level-tabs { display:flex; flex-wrap:wrap; gap:8px; max-height:140px; overflow-y:auto; padding:2px 0 8px; }
.level-tab { border-radius:9px; background:#1b2f55; color:#e2eaff; border:1px solid #7383a7; padding:9px 13px; font-weight:750; font-size:12px; max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.level-tab:hover:not(:disabled) { background:#3b598b; }
.level-tab.selected { background:#fff0aa; border-color:#ffe08c; color:#203456; box-shadow:0 3px 0 #d4b969; }
.level-tab:disabled { opacity:.6; cursor:default; }
.level-manager-actions { display:flex; gap:8px; flex-wrap:wrap; padding-top:6px; }
.level-manager-actions button { padding:8px 12px; font-size:12px; }
.level-manager-actions button:disabled { opacity:.45; cursor:not-allowed; }
#levelManagerHelp { color:#c8d8ef; font-size:12px; margin:9px 0 0; line-height:1.5; }
@media(max-width:650px){.level-manager {padding:13px;} .game-name-field{width:100%;flex-wrap:wrap}.game-name-field input{flex:1;width:100%;min-width:0}.level-manager-actions button{padding:8px 10px}}


/* BOUNCE! Mobile-Landscape – kein Scrollen, Spiel im sichtbaren Viewport. */
html.mobile-landscape, html.mobile-landscape body {
  width: 100%; height: 100%; min-height: 0;
  overflow: hidden; overscroll-behavior: none;
}
html.mobile-landscape body { position: fixed; inset: 0; height: 100dvh; }
html.mobile-landscape .app {
  width: 100%; max-width: none; height: 100%; height: 100dvh; min-height: 0;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
}
html.mobile-landscape .header,
html.mobile-landscape .game-footer,
html.mobile-landscape .below-game { display: none !important; }
html.mobile-landscape .game-frame {
  flex: 0 0 auto;
  width: var(--mobile-game-width, 60vw);
  max-width: 100%; margin: 0;
  border: 2px solid #f4f0d8; border-radius: 10px;
  box-shadow: none;
}
html.mobile-landscape .game-topbar {
  min-height: 33px; gap: 8px; padding: 3px 9px;
}
html.mobile-landscape .stat { min-width: 60px; font-size: 12px; gap: 4px; }
html.mobile-landscape .stat-icon, html.mobile-landscape .time-icon { font-size: 18px; }
html.mobile-landscape .game-topbar .progress-track { display: none; }
html.mobile-landscape .game-topbar .icon-button { margin-left: auto; height: 27px; width: 35px; }
html.mobile-landscape canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; }
html.mobile-landscape .touch-control-panel {
  position: fixed; left: 0; right: 0;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 20; width: 100%; max-width: none; margin: 0;
  padding: 0 max(7px, env(safe-area-inset-right)) 0 max(7px, env(safe-area-inset-left));
  display: flex; align-items: flex-end; justify-content: space-between;
  pointer-events: none;
}
/* Landscape: Richtungstasten kompakt NEBENEINANDER statt untereinander. */
html.mobile-landscape .touch-group { flex-direction: row; flex-wrap: nowrap; gap: 6px; }
html.mobile-landscape .touch-group .touch-button { flex: 0 0 50px; min-width: 50px; width: 50px; height: 54px; }
html.mobile-landscape .touch-button {
  pointer-events: auto; min-width: 70px; width: 70px; height: 54px;
  padding: 0; font-size: 26px; border-radius: 13px;
  opacity: .94; -webkit-tap-highlight-color: transparent;
}
html.mobile-landscape .jump-button {
  min-width: 96px; width: 96px; height: 65px;
  flex-direction: column; gap: 0; font-size: 25px;
}
html.mobile-landscape .jump-button span { font-size: 10px; }
html.mobile-landscape .screen-overlay { padding: 3px; }
html.mobile-landscape .modal {
  width: min(430px, 96%); max-height: 100%;
  padding: 7px 13px 11px; border-width: 2px;
  transform: none; box-shadow: 0 3px 10px #111c3580;
}
html.mobile-landscape .modal-icon { display: none; }
html.mobile-landscape .modal-eyebrow { font-size: 9px; letter-spacing: .1em; }
html.mobile-landscape .modal h1 { font-size: clamp(17px, 4.5vh, 24px); margin: 4px 0; }
html.mobile-landscape .modal p { font-size: 11px; margin: 4px auto 8px; line-height: 1.25; }
html.mobile-landscape .control-hint { margin: 6px 0 10px; font-size: 10px; gap: 7px; }
html.mobile-landscape .primary-button {
  width: min(240px, 96%); padding: 8px 12px; font-size: 12px;
}
html.mobile-landscape .toast { top: 40px; font-size: 11px; padding: 6px 9px; }
@media (max-height: 320px) {
  html.mobile-landscape .modal p, html.mobile-landscape .control-hint { display: none; }
  html.mobile-landscape .touch-button { height: 45px; min-width: 46px; width: 46px; }
  html.mobile-landscape .touch-group { gap: 5px; }
  html.mobile-landscape .touch-group .touch-button { flex-basis: 46px; min-width: 46px; width: 46px; height: 45px; }
  html.mobile-landscape .jump-button { width: 78px; height: 54px; min-width: 78px; }
}

