/* ============================================================
 * MINIWORLDS PYODIDE WEB-PLAYER — csstemplate.css
 * ============================================================ */

.mw-entry {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mw-file-ref {
  display: none;
}

/* Einzelansicht */
.mw-player-single {
  max-width: 680px;
}

/* Listenansicht */
.mw-player-list {
  max-width: 640px;
}

/* Trennlinie zwischen List-Einträgen */
.mw-entry + .mw-entry {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #dee2e6;
}

/* Metadaten-Zeile: user · date links, Aktionen rechts */
.mw-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: #555;
  padding: 4px 0 6px;
  flex-wrap: wrap;
}

.mw-meta a {
  color: inherit;
}

.mw-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Toolbar (Titel + Buttons) */
.mw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}

.mw-title {
  font-size: 1.05rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.mw-toolbar-right {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

/* Canvas-Bühne: neutraler Placeholder-Hintergrund */
.mw-stage {
  position: relative;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #f0f1f3;
  overflow: hidden;
  margin-top: 4px;
  min-height: 120px;
}

.mw-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Vollbild */
.mw-stage:fullscreen,
.mw-stage:-webkit-full-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: none;
  border-radius: 0;
}
.mw-stage:fullscreen .mw-canvas,
.mw-stage:-webkit-full-screen .mw-canvas {
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
}

/* Status-Overlay */
.mw-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  max-width: calc(100% - 2rem);
  background: rgba(255, 255, 255, .93);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: .875rem;
  line-height: 1.4;
  z-index: 10;
  text-align: center;
}

.mw-status.mw-error {
  border-color: #c00;
  color: #c00;
  white-space: normal;
}

.mw-status[hidden] {
  display: none !important;
}

/* Buttons */
.mw-fullscreen-btn {
  flex-shrink: 0;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: transparent;
  color: #555;
  padding: 5px 9px;
  cursor: pointer;
  font: inherit;
  font-size: .875rem;
  line-height: 1;
}
.mw-fullscreen-btn:hover {
  border-color: #555;
  color: #222;
}

.mw-start-btn {
  flex-shrink: 0;
  border: 1px solid #1a5fb4;
  border-radius: 4px;
  background: #1a5fb4;
  color: #fff;
  padding: 5px 14px;
  cursor: pointer;
  font: inherit;
  font-size: .875rem;
}

.mw-start-btn:disabled {
  opacity: .6;
  cursor: default;
}

/* Konsole: versteckt wenn leer */
.mw-console {
  margin-top: 6px;
  min-height: 48px;
  max-height: 200px;
  overflow-y: auto;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 6px;
  padding: 8px;
  font-size: .75rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.mw-console:empty {
  display: none;
}

/* Listenansicht: Stage bis zum ersten Start versteckt */
.mw-stage-hidden {
  display: none;
}

/* Link zur Einzelansicht */
.mw-more-link {
  font-size: .8rem;
  color: #555;
  text-decoration: none;
}
.mw-more-link:hover {
  color: #1a5fb4;
  text-decoration: underline;
}
