html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* Apply box-sizing globally */
}

*, *:before, *:after {
  box-sizing: inherit; /* Inherit box-sizing */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #1e1e1e;
  color: #f0f0f0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Prevent scrollbars on body */
  display: flex;
  justify-content: center;
  align-items: center;
}

#unity-container {
  position: relative;
  /* width/height will be set by canvas or specific classes */
}

/* Desktop styles */
#unity-container.unity-desktop {
  /* Centering is handled by body flex. Canvas size is set by JS. */
}

/* Mobile styles */
#unity-container.unity-mobile {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  /* This ensures it fills the viewport, overriding body's flex for its own positioning */
}

#unity-canvas {
  background: #000000; /* Dark canvas background */
  /* width and height are set by Unity script or inline attributes */
}

.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none; /* Shown by script when loading starts */
  width: 250px;
  text-align: center;
}

#unity-logo {
  display: none; /* Hidden for a minimalist look */
}

#unity-progress-bar-empty {
  width: 100%;
  height: 12px;
  background-color: #333333;
  border-radius: 6px;
  margin-top: 15px;
  padding: 2px;
}

#unity-progress-bar-full {
  width: 0%; /* Controlled by script */
  height: 100%;
  background-color: #0078d4;
  border-radius: 4px;
}

/* Footer common styles (Desktop) */
#unity-footer {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1; /* Ensure footer is above canvas if canvas has its own stacking context */
}

#unity-logo-title-footer {
  display: none; /* Hidden for minimalism */
}

#unity-build-title {
  line-height: 38px;
  font-size: 14px;
  color: #cccccc;
  order: 1;
  /* Allow title to take space but truncate if too long */
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 10px; /* Space between title and button */
}

#unity-fullscreen-button {
  cursor: pointer;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23e0e0e0' d='M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z'/%3E%3C/svg%3E");
  background-position: center center; /* Explicitly center */
  background-repeat: no-repeat;
  background-size: contain;
  order: 2;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

#unity-fullscreen-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile specific footer and fullscreen button */
.unity-mobile #unity-footer {
  display: flex; /* Make footer visible on mobile */
  position: fixed; /* Position relative to viewport */
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto; /* Adjust height based on content */
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background for visibility */
  justify-content: space-between;
  align-items: center;
  z-index: 2; /* Ensure it's above canvas */
}

.unity-mobile #unity-build-title {
  font-size: 12px;
  color: #dddddd;
  line-height: normal; /* Reset line height for mobile footer */
  margin-left: 5px;
  flex-grow: 1; /* Allow title to take space */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 10px;
}

.unity-mobile #unity-fullscreen-button {
  width: 32px;
  height: 32px;
  background-size: contain;
  /* background-position, background-repeat, etc. are inherited or remain the same */
  margin-right: 5px;
  order: 2;
  flex-shrink: 0;
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translate(-50%);
  background: #2c2c2c;
  color: #f0f0f0;
  padding: 10px;
  display: none; /* Shown by script */
  border-radius: 4px;
  border: 1px solid #444444;
  z-index: 100;
  font-size: 14px;
}

canvas, body {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE 10+ */
  user-select: none;         /* Standard syntax */
}
