:root{
  --bg: #0b0f19;
  --panel: rgba(255,255,255,0.06);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --border: rgba(255,255,255,0.12);
  --accent: #5eead4;
  --radius: 14px;
  --topbar-h: 54px;
}

/* Base */
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Zentriert den Player */
#app {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Unity Container: Startgr��e 1280x720 (Desktop), skaliert runter bei kleineren Screens */
#unity-container{
  width: 1280px;
  height: 720px;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;

  position: relative; /* wichtig: f�r Loading/Banner Positionierung */
  display: flex;
  flex-direction: column;

  background: #000;
  border-radius: var(--radius);
  overflow: hidden; /* wichtig: keine �berl�ufe */
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

/* Topbar (nimmt Platz weg, �berlappt nicht) */
#topbar {
  position: relative;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  z-index: 5;
  background: rgba(11,15,25,0.45);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(94,234,212,0.55);
}
.brand .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions { display: flex; align-items: center; gap: 10px; }

.btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}
.btn:hover { background: rgba(255,255,255,0.12); }

/* Canvas f�llt den restlichen Bereich unter der Topbar */
#unity-canvas{
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  outline: none;
  touch-action: none;
}

/* Loading Overlay: nur �ber dem Canvas-Bereich, nicht �ber der Topbar */
#loading {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--topbar-h);

  display: grid;
  place-items: center;
  z-index: 10;
  background: radial-gradient(ellipse at center, rgba(94,234,212,0.08), rgba(11,15,25,0.9) 55%, rgba(11,15,25,1));
}
#loading.hidden { display: none; }

.loading-card {
  width: min(520px, calc(100% - 28px));
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  color: var(--text);
}
.loading-title { font-size: 16px; font-weight: 900; margin-bottom: 10px; }
.loading-text { margin-top: 10px; font-size: 13px; color: var(--muted); }

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(94,234,212,0.85), rgba(94,234,212,0.35));
}

/* Banner (optional) */
#banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 10px;
  z-index: 20;
  pointer-events: none;
}

/* Mobile: Container nutzt ganzen Screen */
@media (max-width: 900px) {
  #unity-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
  }
}
